php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #26633 exec(), system() and backtick give maximum execution time error with Apache
Submitted: 2003-12-15 12:28 UTC Modified: 2011-01-02 13:08 UTC
From: jruffer at hss dot co dot uk Assigned:
Status: Closed Package: Reproducible crash
PHP Version: 4CVS OS: DG/UX
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: jruffer at hss dot co dot uk
New email:
PHP Version: OS:

 

 [2003-12-15 12:28 UTC] jruffer at hss dot co dot uk
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 = me@localhost.com
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


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-12-15 12:53 UTC] jruffer at hss dot co dot uk
set_time_limit(0) makes it work.
 [2003-12-15 17:14 UTC] sniper@php.net
Dunno what DG/UX even is, apparently not any OS we can support. (and as you have modified the sources yourself..)


 [2003-12-16 05:39 UTC] jruffer at hss dot co dot uk
DG/UX is the OS used by Data General Unix machines.  It uses GNU C.  I made the changes because it would not compile without them.
 [2003-12-29 07:58 UTC] jruffer at hss dot co dot uk
I could compile without changing the sources by adding a CFLAG of -DHAVE_SCANDIR and by creating a library with the extra function.
Don't you support PHP on Unix?
 [2011-01-01 23:32 UTC] jani@php.net
-Status: Open +Status: Wont fix -Package: Feature/Change Request +Package: Reproducible crash
 [2011-01-01 23:32 UTC] jani@php.net
This all works in current *nix variants just fine. Will not waste time on changing working code for some long dead unix variant.
 [2011-01-02 13:08 UTC] jruffer at hss dot co dot uk
-Status: Wont fix +Status: Closed
 [2011-01-02 13:08 UTC] jruffer at hss dot co dot uk
That's OK.  I don't use DG/UX anymore.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 15:01:28 2024 UTC