Execution timeout using CLI
| From: | Rich Garabedian | Date: | Tue, 15 Apr 2003 18:27:29 +0000 |
| Subject: | Execution timeout using CLI | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-27109@lists.php.net to get a copy of this message | ||
Hi,
I just inherited a bunch of PHP code that interacts extensively with a
postgresql database. Execution of this script can take many minutes -
sometimes more than 30. The tables the script is running against grow
continually, and recently the script has been timing out with this error:
Fatal error: Maximum execution time of 300 seconds exceeded in dbbind.php
on line 17
This script "require_once"s several other scripts. Once of these, itself,
"require_once"s the dbbind.php script mentioned in the error above. Line
number 17 looks like this:
$t=pg_fieldtype($rs,$col);
The original script is being invoked at the command line like this:
/mm/php-cmdline-431/bin/php -f script_to_run.php
My major question here is why am I timing-out? I thought CLI PHP would wait
forever for execution? Do I need to set a timeout someplace for db
operations? Overall, the problem has to do with poor system architecture and
table locking. However I don't have the time to re-architect the entire
system and am hoping there is a quick fix to prevent, or lengthen, the
timeout.
Any help is greatly appreciated.
Rich
For further data, if I look at php config (as shown by running php -i) I see
the following(edited out a lot of lines for clarity)
phpinfo()
PHP Version => 4.3.1
System => Linux linux01.ourdomain.com 2.4.2-2smp #1 SMP Sun Apr 8 20:21:34
EDT 2001 i686
Build Date => Apr 8 2003 14:50:57
Configure Command => './configure' '--disable-cgi'
'--with-pgsql=/usr/pgsql/' '--prefix=/mm/php-cmdline-431'
Server API => Command Line Interface
Virtual Directory Support => disabled
Configuration File (php.ini) Path => /mm/php-cmdline-431/lib
PHP API => 20020918
PHP Extension => 20020429
Zend Extension => 20021010
Debug Build => no
Thread Safety => disabled
Registered PHP Streams => php, http, ftp
This program makes use of the Zend Scripting Language Engine:
Zend Engine v1.3.0, Copyright (c) 1998-2002 Zend Technologies
_______________________________________________________________________
Configuration
PHP Core
max_execution_time => 0 => 30