From: Operating system: RHEL Server 5.1 PHP version: 5.3.2 Package: OCI8 related Bug Type: Bug Bug description:Using oci_connect causes PHP to take a long time to finish
Description: ------------ NOTE: all of this happens when using PHP from the command line, don't know about other cases, that is harder to measure. Using oci_connect with PHP 5.3.2 (or 5.3.1 or snap php5.3-201006161430) against Oracle 10.2.0.4 causes a PHP script to hang for about a second after all code has been run. Script doesn't crash, just takes way too long to finish. i.e. one can do something like this print "FIRST LINE OF CODE\n"; oci_connect('user', 'pass'); print "LAST LINE OF CODE\n"; and after "LAST LINE OF CODE" is printed, the program will hang for about a second, then finish. If you remove the oci_connect line, the program runs without any post-code hangup. PHP 5.2 on the same machine runs with no problems. Note: the problem happens if the user/pass are correct or not. What works and what doesn't against Oracle 10.2.0.4: PHP 5.2 (oci8 1.2.4) -> works fine PHP 5.3.1 (oci8 1.3.5) -> hangs for around one second PHP 5.3.2 (oci8 1.4.1) -> hangs for around one second PHP 5.3-201006161430 (oci8 1.4.2-dev) -> hangs for around one second What works and what doesn't against Oracle 10.2.0.3: PHP 5.2 (oci8 1.2.4) -> works fine PHP 5.3.1 (oci8 1.3.5) -> works fine PHP 5.3.2 (oci8 1.4.1) -> works fine PHP 5.3-201006161430 (oci8 1.4.2-dev) -> works fine Seems to be related to 10.2.0.4 and certain versions of PHP's oci8. All these PHP's were built with the same configure line: ./configure --prefix=/opt/php --with-oci8 --with-apxs2=/opt/apache2/bin/apxs --enable-ftp --with-xmlrpc --with-iconv --with-curl --with-pear --enable-pcntl --with-zlib --with-readline I have tested everyone of the above PHP's using 'php -n' (no php.ini). Again, the bug only manifests on Oracle 10.2.0.4. Test script: --------------- <?php #run this script from the command line with the 'time' command on linux, like so, to see the problem: # # time php -n myscript.php # print "before connect: ".microtime(true)."\n"; oci_connect('user', 'pass'); print "after connect: ".microtime(true)."\n"; #Note that the slowdown isn't bound to oci_connect, #The two print statements will happen BEFORE the slowdown occurs, #i.e. after all PHP code has been processed. #using strace on the script with the '-c' is also interesting... ?> Expected result: ---------------- I expect the script to complete in .05 to .15 seconds (or so). Actual result: -------------- Script takes at least a full second to finish, after all code has been executed. -- Edit bug report at http://bugs.php.net/bug.php?id=52103&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=52103&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=52103&r=trysnapshot53 Try a snapshot (trunk): http://bugs.php.net/fix.php?id=52103&r=trysnapshottrunk Fixed in SVN: http://bugs.php.net/fix.php?id=52103&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=52103&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=52103&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=52103&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=52103&r=needscript Try newer version: http://bugs.php.net/fix.php?id=52103&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=52103&r=support Expected behavior: http://bugs.php.net/fix.php?id=52103&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=52103&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=52103&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=52103&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=52103&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=52103&r=dst IIS Stability: http://bugs.php.net/fix.php?id=52103&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=52103&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=52103&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=52103&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=52103&r=mysqlcfg