php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50891 Crash on mysql_connect
Submitted: 2010-01-31 03:13 UTC Modified: 2013-02-18 00:34 UTC
Votes:7
Avg. Score:4.6 ± 0.7
Reproduced:7 of 7 (100.0%)
Same Version:5 (71.4%)
Same OS:4 (57.1%)
From: other dot pouya at gmail dot com Assigned:
Status: No Feedback Package: MySQL related
PHP Version: 5.2.12 OS: win32 only - Win XP
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 you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: other dot pouya at gmail dot com
New email:
PHP Version: OS:

 

 [2010-01-31 03:13 UTC] other dot pouya at gmail dot com
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 

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-01-31 14:33 UTC] jani@php.net
Please try using this snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/


 [2010-01-31 16:25 UTC] other dot pouya at gmail dot com
Thanks for you attention.
I checked the link you provide but there was nothing there. It was just written "5.2 has no release" as well as other versions.
 [2010-02-08 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2010-02-28 15:05 UTC] apaleftos at gmail dot com
I have the exact same problem, same php/mysql/apache versions
 [2010-02-28 16:25 UTC] pajoye@php.net
Try with 5.2.13.

Also be sure that you don't have any other libmysql DLL in your PATH but the one we bundled in PHP releases. That may happen if you installed mysql after PHP.
 [2013-02-18 00:34 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 05:01:30 2024 UTC