I'm getting a strange 5 to 7 second pause when executing PHP scripts from the command-line PHP client (PHP 5.2 on Windows).
During this pause the PHP script just appears to 'freeze' for a while before returning to the command prompt. It is not using any significant CPU time, it's like it is waiting for some delay.
After experimenting with PHP.ini, I've narrowed this down to the fact that the mysql or mysqli extension is enabled. If these extensions are both disabled, no annoying pause and the PHP script terminates in mere milliseconds.
The command I'm using is:
"C:\Program Files\PHP\php.exe" -f %1
Where %1 is the PHP script.
The pause still occurs even if the PHP script being executed is essentially empty:
<?php
?>
Do you know what is causing this pause and how I can remove it while still allowing mysql or mysqli support for PHP on the command line?
I also experienced an annoying 2 second delay running PHP from the command line under Windows 7 64bit.
This version had a delay:
php.exe (v5.3.5) shipped with ZendServer Community EditionThis version was wonderfully quick:
php.exe (v5.3.6) shipped with EasyPHP
(Sorry to bump an ancient thread, but hopefully this helps others Googling this issue.)
For me (Zend Server CE on Mac OS X), the imap exetension was the culprit. Disabling it solved the problem.
Anoyone wants to write a PHP extension bisecting script? :)
it's a bug in mysql. you can solve it by getting the latest libmysql.dll (5.1.31 or higher. some older versions also work - see second link). make sure that's the libmysql.dll actually used and there are no other libmysql.dlls in your path. see the related php issue for details.