Written by Anthony Chambers , and read7,502 times
I've been trying to get the latest Magento 1.7 running on a WAMP server, and every time I tried I got a Connection Reset message in Firefox. I couldn't even run the installer. So I ran the installer from a command line, which went fine, but I still couldn't view the site in my browser.
I checked my VHOSTS config, and it's all good. I checked the VHOST log file, and nothing in there that explains it either. Then I checked the Apache logs and I saw this:
[Thu Aug 16 15:05:53 2012] [notice] Parent: child process exited with status 255 -- Restarting. [Thu Aug 16 15:05:53 2012] [notice] Apache/2.2.21 (Win64) PHP/5.3.9 configured -- resuming normal operations [Thu Aug 16 15:05:53 2012] [notice] Server built: Sep 24 2011 19:57:51 [Thu Aug 16 15:05:53 2012] [notice] Parent: Created child process 5200 [Thu Aug 16 15:05:53 2012] [notice] Child 5200: Child process is running [Thu Aug 16 15:05:53 2012] [notice] Child 5200: Acquired the start mutex. [Thu Aug 16 15:05:53 2012] [notice] Child 5200: Starting 64 worker threads. [Thu Aug 16 15:05:53 2012] [notice] Child 5200: Starting thread to listen on port 80. [Thu Aug 16 15:05:53 2012] [notice] Child 5200: Starting thread to listen on port 80.
I tried all sorts of different configuration options and nothing worked. Then I hit the almighty Google in search of an answer. Surprisingly, the answer did not come from a Magento topic, but rather a Drupal topic instead.
A bit of background before we continue:
This particular site is running on my Windows workstation. I'm running Windows 7 64-bit on a Core-i7 3930k and 32GB RAM. I'm running WAMPServer 2.2 and specifically Apache 2.2.21, PHP 5.3.9 and MySQL 5.5.20
According to the Drupal forums, there is a known bug in PHP versions < 5.3.11 whereby any file that is an exact multiple of 4096 bytes (4KiB) will cause Apache to crash and restart (as you see mine was from the logs above).
So, I'll upgrade my PHP to a minimum 5.3.11, no problem. Only the WAMPServer download page doesn't have an available plugin for PHP > 5.3.1 (even though mine came with 5.3.9 installed). Not fancying having to go through installing WAMP again and risking losing my current config, I decided to hunt down any files that were exactly 4096 bytes and edit them. In Windows this is really easy:
- Navigate to your Magento directory
- In the search box in the top right, type in: size:4096
- In the results I saw: \app\code\core\Mage\Core\Controller\Varien\Router\Admin.php and \lib\Zend\Form\Decorator\Fieldset.php
- Open each and immediately after the <?php tag just enter a space
I actually only needed to do the admin page in order to get the site up and running again, but I figured I should sort Fieldset.php out as well, as it may come back to haunt me at a later date.
It's also worth checking for files that are a multiple of this size. Try 8192, 12288 and 16384 at the very least. I didn't find any myself, but you never know if you will be so lucky.
So, if upgrading your PHP isn't practical, there's your solution. I hope that helps someone