PHP5.2.8 And MySQL 5.1 Crashing Apache 2.2 On Windows?

OK. I've just spent two hours trying to sort this problem out so I thought I would pass on the info.

I installed Apache and PHP and they worked fine, but every time I tried to run any MySQL commands through PHP the Apache server would simply crash.

After looking at the Event Viewer the problem appears to be from a file called php5ts.dll, but trying to do anything with this file will lead you down a blank alley.

What is happening is to do with a file called libmysql.dll. This file can be found in your PHP directory, but it is also to be found in your MySQL install directory. This is where the problem lies. When Apache asks for the libmysql.dll file it will receive the one in the MySQL directory because this included in the Windows PATH variable. This version of the libmysql.dll file causes Apache to crash.

At first I tried to add the PHP folder to the end of the PATH, but this didn't work. What you need to do is add the PHP folder BEFORE the MySQL folder.

Comments

All I have to say is THANK YOU! I had Apache 2.0.63, Mysql 5.0 working fine on a test box. I moved to MySQL 5.1, and everything stopped working, crashing Apache. This fixed my problems.
Permalink

Add new comment

The content of this field is kept private and will not be shown publicly.
CAPTCHA
5 + 13 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.