tags:

views:

1473

answers:

5

I have many php script with several iterations on rows from a mysql database, every iteration opens another extra connection to get extra data not included in the original select. Suddenly, somewhere in the middle of theese scripts the Connection from Apache resets while is executing the script (and reading from the mysql database).

In Apache's error.log the following error is shown: Parent: child process exited with status 255

The system works perfectly up to 5.2.9 but doesn't work with 5.3.0 nor 5.3.1-dev, this is why I thing is a php5.3-related problem.

I'm sorry but i could not reproduce this problem in a short script, I even open a bug report en php.net site of this?

Windows 7 RC Apache 2.2.11

Did anyone of you guys experienced the same problem after upgrading to php 5.3?

UPDATE:

I could isolate the error down to:

<?
    $dbh=mysql_connect ("localhost", "root", "mysqluser") or die 
('I cannot connect to the database because');
    mysql_select_db ("bbbac_globaldata") or die( "Unable to select 
database");


    mysql_close();

?>

Comment out mysql_close() and no error will happen.

This is the PHP bug I filled: http://bugs.php.net/bug.php?id=48943

UPDATE

This is a KNOWN php 5.3 bug with mysql_close() when no argument is given:

http://bugs.php.net/bug.php?id=48754

THANKS FOR ALL THE HELP!!!

A: 

I looked at your question because I thought this might be similar to something I'd seen before, but the error code turned out to be different. Nonetheless, I googled your error message and found this link: http://forums.tizag.com/showthread.php?t=4204 It looks like maybe you have a circular reference in your files (i.e. php_file1 includes php_file2, which includes php_file1).

PTBNL
thanks, but the strange thing is that I dont have any circular reference! And this works without problms in php 5.2.9
Guillermo
A: 

I nearly have the same env. with yours. Win7 RC with xampp 1.7.1 (Apache/2.2.11 (Win32) DAV/2 mod_ssl/2.2.11 OpenSSL/0.9.8i PHP/5.2.9 and MySQL client version: 5.0.51a and Mysql Server version: 5.1.33-community)

i saw exactly the same problem with php 5.2.9 at first. in ntlogs apache service exited with 255 bla bla... it was a simple script.. then i've tried to use my own mysql wrapper which simpler than simple script :). there was a strange situation at that point. once it exits once works. then i've tried to search everywhere for that problem. as you knew nothing i've found. in windows xp it worked without problem. so i thought it's a win7 problem. UAC was already disabled. and also i tried take ownership of whole xammp folder (which contains everything apache php mysql filezillaftp). after a restart those are all installed as service. it worked. i don't know why. but taking ownership of folders recursively is working. i advice you to try that.

risyasin
Hello,This is clearly a problem with mysql_close().This is a known bug:http://bugs.php.net/bug.php?id=48754
Guillermo
A: 
Luc M
Thanks LUc,yes I think I tried 50 times :-)
Guillermo
A: 

php 5.3 includes a new mysql-driver (mysqlnd). You might want to check if you're using this or the "old" libmysql driver.

Other than that, is it possible for you to rewrite your script so that you don't open and close the database on each iteration? It's a bad practise really and it might be the cause of some kind of buffer filling up.

troelskn
A: 

You are probably using PHP 5.3 VC9. It has some known problems with Apache2.2 on Vista and Windows 7. Download and install the version compiled with VC6.

Andrew Moore
Thanks andrew, this was one of the firsts steps i tried. I did but this one is clearly a PHP bug with mysql_close() when no connection pointer is given as an argument.
Guillermo