#50891 [NEW]: Crash on mysql_connect

From: Date: Sun, 31 Jan 2010 03:13:46 +0000
Subject: #50891 [NEW]: Crash on mysql_connect
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-147067@lists.php.net to get a copy of this message
From: other dot pouya at gmail dot com Operating system: Win XP PHP version: 5.2.12 PHP Bug Type: Apache2 related Bug description: Crash on mysql_connect Description: ------------ Dear PHP team I have apache 2.2.14 , php 5.2.12 and mysql 5.1 running on XP. Php and apache are fine when I test phpinfo() or other php commands which are not related to mysql. But when I try to connect to mysql, the apache sever crashes and the following error pops up: Apache HTTP Server has encountered a problem and needs to close. We are sorry for the inconvenience. clicking for details I have this error signature: szAppName : httpd.exe szAppVer : 2.2.14.0 szModName : php5ts.dll szModVer : 5.2.12.12 offset : 0000ac6a I ran the code step by step, and I realize the problem is related to the line $link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD); This is apache error.log after clicking "don't send" on the crashing pop-up: [Sun Jan 31 04:03:57 2010] [notice] Parent: child process exited with status 3221225477 -- Restarting. [Sun Jan 31 04:03:57 2010] [notice] Apache/2.2.14 (Win32) PHP/5.2.12 configured -- resuming normal operations [Sun Jan 31 04:03:57 2010] [notice] Server built: Sep 28 2009 22:41:08 [Sun Jan 31 04:03:57 2010] [notice] Parent: Created child process 584 [Sun Jan 31 04:03:58 2010] [notice] Child 584: Child process is running [Sun Jan 31 04:03:58 2010] [notice] Child 584: Acquired the start mutex. [Sun Jan 31 04:03:58 2010] [notice] Child 584: Starting 64 worker threads. [Sun Jan 31 04:03:58 2010] [notice] Child 584: Starting thread to listen on port 80. Reproduce code: --------------- <?php session_start(); require_once('config.php'); $errmsg_arr = array(); $errflag = false; //so far there was no problem. after this comment it crashes $link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD); if(!$link) { die('Failed to connect to server: ' . mysql_error()); } . . . ?> Expected result: ---------------- Connecting to mysql. Actual result: -------------- Apache HTTP Server has encountered a problem and needs to close. We are sorry for the inconvenience. szAppName : httpd.exe szAppVer : 2.2.14.0 szModName : php5ts.dll szModVer : 5.2.12.12 offset : 0000ac6a -- Edit bug report at http://bugs.php.net/?id=50891&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=50891&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=50891&r=trysnapshot53 Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=50891&r=trysnapshot60 Fixed in SVN: http://bugs.php.net/fix.php?id=50891&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=50891&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=50891&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=50891&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=50891&r=needscript Try newer version: http://bugs.php.net/fix.php?id=50891&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=50891&r=support Expected behavior: http://bugs.php.net/fix.php?id=50891&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=50891&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=50891&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=50891&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=50891&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=50891&r=dst IIS Stability: http://bugs.php.net/fix.php?id=50891&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=50891&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=50891&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=50891&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=50891&r=mysqlcfg

« previous php.bugs (#147067) next »