From:             jruffer at hss dot co dot uk
Operating system: DG/UX
PHP version:      4.3.4
PHP Bug Type:     Apache related
Bug description:  exec(), system() and backtick give maximum execution time error with 
Apache

Description:
------------
These functions work fine using the CLI but when used with Apache give a
spurious execution timeout error.  I tried setting the timeout to 30000
and it still happened immediately.  The problem occurs with any command
that I try to call using system(), exec() or backtick.  I do not have
safe-mode enabled.

I did have a couple of porting problems with DG/UX.  I had to add #include
<sys/dir.h> to main/php_scandir.h and
double expm1(double x)
{
  return(exp(x));
}
before #include "php.h" in ext/standard/math.c


'./configure' '--with-ingres=/OI/ingres' '--without-mysql' '--enable-ftp'
'--enable-cli' '--enable-cgi'
'--with-apache=/usr/opt/apache/apache_1.3.29' 

php.ini:
safe_mode_exec_dir = /usr/
log_errors = On
report_memleaks = Off
track_errors = On
error_log = /usr/opt/apache/www/logs/php.log
sendmail_from = [EMAIL PROTECTED]
ingres.allow_persistent = Off
ingres.default_database = divtest
ingres.default_user = devdba

Reproduce code:
---------------
<?php
  print "<html>\n";
  print "<h2 align='center'>Attempting to run `ls -l` </h2>\n";
  $list = `ls -l`;
  foreach($list as $value) {
  print "$list<br>\n";
  print "</html>\n";
?>

Expected result:
----------------
Attempting to run `ls -l`

total 97 -rw-r--r-- 1 jeremy general 5520 Dec 12 09:56 build_status.php
-rw-r--r
-- 1 jeremy general 501 Dec 12 10:24 cr.menu -rw-r--r-- 1 jeremy general
365 Dec
 2 08:49 debug.inc lrwxrwxrwx 1 jeremy general 11 Dec 2 09:36 doc ->
/phase3/doc
 -rw-r--r-- 1 jeremy general 3868 Dec 10 18:29 image_request.php
-rw-r--r-- 1 je
remy other 2543 Dec 2 17:31 images.php -rw-r--r-- 1 jeremy general 86 Dec
12 11:
00 index.html -rw-r--r-- 1 jeremy general 362 Dec 1 16:12 index.old.html
-rw-r--
r-- 1 jeremy general 77 Dec 10 12:08 info.php -rw-r--r-- 1 jeremy general
105 De
c 12 11:21 ingkey.err -rw-r--r-- 1 jeremy general 386 Dec 12 12:21
init.inc -rw-
r--r-- 1 jeremy general 786 Dec 12 15:17 login.inc -rw-r--r-- 1 jeremy
general 2
05 Dec 12 11:10 login.php -rw-r--r-- 1 jeremy general 863 Dec 12 10:55
menu.php
-rw-r--r-- 1 jeremy general 1899 Dec 3 10:31 release.php -rw-r--r-- 1
jeremy gen
eral 569 Dec 7 10:08 resume.php -rw-r--r-- 1 jeremy general 1041 Dec 11
17:52 ru
n_signoff.php -rw-r--r-- 1 jeremy general 857 Dec 12 15:18 secure.inc
-rw-r--r--
 1 jeremy general 6712 Dec 15 09:30 signoff.php -rw-r--r-- 1 jeremy
general 1046
 Dec 3 11:37 suspend.php -rw-r--r-- 1 jeremy general 619 Dec 5 16:45
tech.html -
rw-r--r-- 1 jeremy general 155 Dec 15 17:08 test.php -rw-r--r-- 1 jeremy
general
 2379 Dec 10 16:51 update_queue.php -rw-r--r-- 1 jeremy general 2783 Dec
10 16:4
8 update_queue.v1.php -rw-r--r-- 1 jeremy general 277 Dec 12 12:23
wrap.inc


Actual result:
--------------
Attempting to run `ls -l`

Fatal error: Maximum execution time of 30 seconds exceeded in
/usr/opt/apache/www/htdocs/image/test.php on line 4


-- 
Edit bug report at http://bugs.php.net/?id=26633&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=26633&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=26633&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=26633&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=26633&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=26633&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=26633&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=26633&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=26633&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=26633&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=26633&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=26633&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=26633&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=26633&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=26633&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=26633&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=26633&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=26633&r=float

Reply via email to