PHP Bugs and Errors

Running Apache + PHP + Accelerators under Windows 2003

I have been getting some instability running Apache with PHP + Accelerators under Windows 2003. I will log my finds in this article. Visit regularly for updates. I ended up running 7 Apaches on a Windows 2003 Server to test all different kinds of configurations. Recently because it was becoming complex, I started logging my finds. This page is probably for the hardcore debugging type...

Mitigating factors:
- Most crash seem to happen because of load (with very low traffic you might never experience problems).
- My PHP applications are very demanding. Especially Gallery2 which relies on external libraries for processing images. Again other PHP applications might not experience these problems.
-If you have issues with IIS, these finding might also be applicable.

auto_globals_jit

APC - superglobals empty once script is cached
Turning "auto_globals_jit" off is a temporary solution
http://pecl.php.net/bugs/bug.php?id=4772

http://www.zend.com/zend/week/week220.php

auto_globals_jit = On
register_globals = Off
register_long_arrays = Off
register_argc_argv = Off

Sample ini files:
http://www.vbulletin.com/forum/showthread.php?t=166310

eAccelerator crash

eAccelerator crash (Updated)

I've created an article to try to track what works and what doesn't: Running Apache + PHP + Accelerators under Windows 2003

After moving a site with some traffic to an Apache 2.2.x server, I have been getting multiple Apache crash per day. Before I was only getting these about once a week. Here is what the error looks like in the Apache error.log:

eAccelerator problem with PHP: Crash under Apache

Once in a while under Apache 2.0.55 or 2.2.2, I would get a crash with a line like the following in the log:
[7508] EACCELERATOR: PHP crashed on opline 48 of preg_replace() at G:\DomZeus\sitebuddycom\wwwroot\modules\search.module:354

This mostly likely an eAccelerator bug (not 100% sure).
Meanwhile here is a solution to try to avoid it. Since in my case the error happens regularly (once a day?) with the file search.module, I decided to tell eAccelerator to stop trying to cache that file with:

APC problem with Gallery 2

Under Apache 2.2.2 and 2.0.55 using APC (3.0.11-dev) I could not delete an image using Gallery2.

My temporary solution is to disable caching of Gallery2 classes in APC with:

apc.filters="-g2.*\.class"

 

PHP: @readfile('aURL') creates Apache crash

Running Apache 2.0.55 or 2.2.0 under Windows with PHP 4.4.2 (the latest 4 version), I get a crash when loading a simple PHP file containing (example file):
<?php
@readfile('http://aDomain/main.php?g2_view=imageblock.External&g2_blocks=randomImage&g2_show=title');
?>

Calling that same URL directly from a browser works fine.

Testing the same file under the latest CVS version of PHP4 (4.4.3?), it works fine. So it must be a bug that was corrected.
It appears to be a bug specific to 4.4.2.
My problem here is that eAccelerator does not work on PHP4 past 4.4.2.

Apache: PHP 4 using mod_rewrite getting blank page

Bug Symptoms: Running Apache (2.2.0 distribution from xampp), with PHP 4, I was getting a blank page. My PHP application was using the Apache module "mod rewrite", it appeared directly related to the "rewrite" links.

Solution: Turned out that if I disable the Apache module "mod_status" it works just fine.

PHP4: php_gettext.dll does not load

I was having problems loading the PHP extension: php_gettext.dll

The solution under PHP4, for me, was to copy the file iconv.dll from the PHP folder "\Dlls" to my systems path (in my case, the folder containing httpd.exe). If your PHP installation folder is defined in your $PATH (like e:\PHP4) you could copy iconv.dll to e:\PHP4.