29
votes

I'm using PHP5, CodeIgniter and Apache. The localhost php pages were loading fine and then suddenly they started crashing Apache.

The web pages seem to get to different stages of loading when apache crashes.

The only interesting line in the Apache error log file says :

[notice] Parent: child process exited with status 3221225477 -- Restarting.

There is a lot of discussion of this issue on the web but it seems there is no one solution, different people have described different solutions that worked for their system.

Suggestions Appreciated.

14
I just ran into this exact problem, and the solution below (copying the DLLs into System32) did not work for me. Anyone else have ideas?Arkaaito
FWIW: 3221225477 is C0000005 in hexadecimal, and that error code happens to mean "access violation". There can be many different reasons for those.Michael Madsen

14 Answers

51
votes

This problem often happens in Windows because of smaller Apache’s default stack size. And it usually happens when working with php code that allocates a lot of stacks.

To solve this issue, add the following at the end of apache config file, httpd.conf

<IfModule mpm_winnt_module>
    ThreadStackSize 8888888
</IfModule>

AND restart apache. i take this solution from this site.

6
votes

I found a solution that worked for me.

I copied the following two files from my PHP directory to the Win32 directory and the errors stopped : php5apache.dll, libmysql.dll.

So even though these files should have been found in the PHP directory under certain circumstances they needed to be in the system dir

4
votes

In my case it was the php extension APC (php_apc.dll, 3.1.10-5.4-vc9-x86, threadsafe), which caused the error.

I used XAMPP 1.8.2 with PHP 5.4.19 and Apache 2.4.4

Since it could be caused by another extension as well, it might be a good starting point to restore the original php.ini from the xampp distribution. If this one works well, try to change it line by line to your desired configuration (starting with the extension list).

2
votes

We are running two copies of Apache, each with their own version of PHP.

After searching for this error and trying different suggestions of copying files into the windows system32 folder, I finally found that the issue seems to be multiple copies of libmysql.dll found in the windows path.

After copying the libmysql.dll file into the apache bin folder we no longer have this problem.

2
votes

I had the problem - and after checking my folders, I realized I did not have the php5apache.dll in my php directory. So I tried copying it from the Win32 folder - and it has improved matters considerably (I won't hold my breath yet :))

2
votes

I just had this problem for a while, apache restarted in every 5-15 minutes. My server serves a lot of sites and a portal with a big traffic, I programmed that portal and I just figured it out that the get_browser() function gives a memory error sometimes (depends on the agent). I refreshed the browscap.ini, no effect, the restarting still happens but as far as I removed to use this function, the apache didn't restart anymore. I use PHP 5.2.6 with Apache 2.0.5x I hope this helps for some other people too.

2
votes

So my php directory did not have libmysql.dll in it this seems to have resolved the problem.

I also added this to the win32 directory and the apache bin directory

1
votes

I experienced tha same problem when I called

$link = mysql_connect('127.0.0.1', $user, $password);

from a PHPscript when running a clean install of WampServer (http://www.wampserver.com/en/)

I tried to copy DLLs, as suggested above, but I could not get it to work.

Finally I changed to UniformServer (http://www.uniformserver.com/) 5.6.16, and it worked as a charm.

Hope this post can save some time for somebody :-)

1
votes

I tried above, but they all did not work.

After long investigation, it was ridiculously easy: in one of my ajax-files I had in the PHP-code the line

mysqlclose();

This was the problem. Everything works fine now.

Just mentioning. Maybe helping people cut their debugtime a bit.

1
votes

This is an openssl_public_encrypt() function in my case.

1
votes

I had this same problem. Copying dll's didn't fix it. So I looked around some more and found this thread with the answer that worked for me. Why does my XAMPP Apache service keep restarting?

In my Nvidia control panel I didn't see the FIrstPacket settings initially, so I uninstalled the Nvidia ForceWare Network Access Manager, then reinstalled it through the Nvidia drivers. After the restart the FirstPacket settings were visible and I made sure it was disabled, then everything worked.

1
votes

It is a problem with a problematic mix of mysql DLLs. See here for a solution: http://www.java-samples.com/showtutorial.php?tutorialid=1050

Copying dlls into system32 is not the best thing to do, so I suggest to install apache+php+mysql properly, rather than copy files into system32, because once the dlls are there - they will be loaded instead of newer version dlls, in a future update.

0
votes

Copy file php5apache.dll from xampp\php\ to Windows\System32\

0
votes

It looks like after some Windows update, this issue may appear if you have open_basedir set, as well. This was discovered by me in https://www.apachelounge.com/viewtopic.php?p=39993
For me commenting out open_basedir resolved the issue and sped up the site significantly.
I plan to look further into it and report it as bug, if applicable. Will update this answer with any news.

Reported as https://bugs.php.net/bug.php?id=80881