I have been following PHP Bug #17868 for some time now (since upgrading to Red Hat 8.0 and Apache 2.0) with quite a bit of interest. This is the bug where multiple include statements don't work and only the first one gets parsed by PHP.

After some debugging, I found a workaround for myself, and was wondering what potential problems this might cause (I haven't found any problems with it yet). The workaround simply involves commenting out the following line in sapi_apache2.c:

ctx->request_processed = 1;

It appears that each time PHP gets called by Apache to parse some PHP code, it checks whether it has already processed the "request". The problem comes when PHP is called by subsequent include statements. In the subsequent calls from the same document, this variable remains set, causing PHP to think it has already processed the subsequent request when in fact it hasn't. (Or, at least, this is my interpretation of what is going on -- I am by no means an expert on this code!)

Like I mentioned before, commenting out the line which sets ctx->request_processed fixes the bug. However, I assume there is (or was at one time) a reason for this variable and checking it. Under what situations could my "fix" cause problems? Is there some way to get PHP into a recursive situation? So far, I have not found a way to break it.

I just wanted to throw this out as a possible workaround (not necessarily a fix) and get some feedback on what may have been unknowingly broken, if anything.

Thanks!
Michael Petersen


--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to