[Solved] Apache Service Crashing In Windows Vista (Ultimate)
Posted by: bdavis (---.finaid.unr.edu)
Date: July 24, 2009 10:11PM

I am sorry if this has already been addressed:

Yesterday I downloaded the most recent version of WAMP Server 2 and installed it to C:\wamp (all basic default settings). This was the first time A.M.P has been installed on this computer. I was able to run a test.php script that was just PHP and it ran fine. I was able to use PHPMyAdmin to connect to MySQL, but when I would run a test_db.php script:

<?php

if ($dbc = mysql_connect('localhost', 'root', '')) {
print '<p>Successfully connected to MySQL.</p>';
mysql_close();
} else {
print '<p>Could not connect to MySQL.</p>';
}

?>

When I tried pulling up the script (http://localhost/test_db.php), it would wait about 5 seconds, then I would get a Windows Error that the Apache service has stopped. The Apache error log only says:

Parent: child process exited with status 255 -- Restarting.

I did find the forum post (http://forum.wampserver.com/read.php?2,51471,51473#msg-51473) that seemed close to my problem and did exactly what it said, but it didn't work.

Since PHPMyAdmin works, I decided to look in the config.inc.php file and it looks like it references the MYSQLI extension (not the MYSQL extension). So I changed my script to using mysqli_connect instead of mysql_connect and now the test_db.php script works (not getting the Windows Error anymore).

I fixed my problem (and hopefully this helps others with the same problem), but why doesn't mysql_connect work? Looks like the php.ini file references both extensions correctly:

extension=php_mysql.dll
extension=php_mysqli.dll

And both .dll files are in the ext directory. Anyone have any suggestions?



Edited 1 time(s). Last edit at 07/27/2009 07:19PM by bdavis.

Options: ReplyQuote
Re: Apache Service Crashing In Windows Vista (Ultimate)
Posted by: brian85 (---.w90-11.abo.wanadoo.fr)
Date: July 27, 2009 12:29AM

Hi,

I noticed that the function mysql_close() is the reason of the crash. why ? I don't know...

please admin help us !

I got the same trouble in XP SP3, i just moved my work on my laptop and have the same trouble sad smiley



Edited 1 time(s). Last edit at 07/27/2009 12:31AM by brian85.

Options: ReplyQuote
Re: Apache Service Crashing In Windows Vista (Ultimate)
Posted by: toumimi (---.114.116-78.rev.gaoland.net)
Date: July 27, 2009 01:02AM

You should have a look at this bug report : [bugs.php.net]

Apparently, you just need to precise connection var into mysql_close function
<?php
   $conn = mysql_connect('ip','user','password');
   mysql_close($conn);
?>

Florian

WampServer Patch (Screenshots)
Topic EN : www.wampserver.com
Topic FR : www.wampserver.com

Options: ReplyQuote
Re: Apache Service Crashing In Windows Vista (Ultimate)
Posted by: brian85 (---.w90-11.abo.wanadoo.fr)
Date: July 27, 2009 01:07AM

Thanks Florian it solved the trouble ! ^_^

Best Regards

Options: ReplyQuote
Re: Apache Service Crashing In Windows Vista (Ultimate)
Posted by: bdavis (---.dsl.renocs.sbcglobal.net)
Date: July 27, 2009 02:09AM

Thank you very much for your explanation. I usually install everything (A.M.P) myself but I haven't for a couple of years, so this error never came to my attention before. So after installing WAMP Server and getting this error on a simple script, I wasn't sure where to look other than these forums.

Options: ReplyQuote
Re: Apache Service Crashing In Windows Vista (Ultimate)
Posted by: toumimi (---.114.116-78.rev.gaoland.net)
Date: July 27, 2009 02:18AM

You're welcome winking smiley
Can you can edit your first post and so others can see there is an answer of this problem here..
[SOLVED] Apache Service Crashing using mysql

Florian

WampServer Patch (Screenshots)
Topic EN : www.wampserver.com
Topic FR : www.wampserver.com

Options: ReplyQuote


Sorry, only registered users may post in this forum.