From: php at timkoop dot com Operating system: Windows NT WEBSERVER 5.2 build 3 PHP version: 5.2.5 PHP Bug Type: Reproducible crash Bug description: PHP crashes after calling exit() from an auto_prepend_file many times.
Description: ------------ When using an auto_prepend file, if you call exit() in this prepended file, it works fine for a while. But after about 400 or 500 or 600 times calling any php page on the website, you receive a simple "No input file specified". And every site in IIS also displays this message on php pages. This page describes why you would want to do this: http://www.ilovejackdaniels.com/php/caching-output-in-php/ Reproduce code: --------------- In php.ini, set an auto_prepend file like this: auto_prepend_file = prepend.php In prepend.php, put something like this: <? echo "<html><body>This comes from prepend.php</body></html>"; exit(); ?> (Actually, this above code might have to be in an included file that was called from prepend.php) Now you have to call any page in the website a few hundred times before the error kicks in. The first few times will appear to work as expected. A small bash script to do this for you might look like this (for your convenience only; not a part of the bug): for ((i=1;i<=1000;i+=1)); do echo $i wget http://yoursite.com/anyfile.php --quiet --output-document=/dev/null done Expected result: ---------------- I would expect the prepended file to produce the following code and the actual called file would not produce anything, so this would be the entire html returned no matter what file you called: <html><body>This comes from prepend.php</body></html> This does actually work the first few hundred times. Actual result: -------------- The expected result is returned (correctly) a few hundred times. Then after that, the following line is returned: No input file specified. After this, IIS must be restarted to get back to normal. I will happily provide a backtrace if needed. -- Edit bug report at http://bugs.php.net/?id=44596&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=44596&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=44596&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=44596&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=44596&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=44596&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=44596&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=44596&r=needscript Try newer version: http://bugs.php.net/fix.php?id=44596&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=44596&r=support Expected behavior: http://bugs.php.net/fix.php?id=44596&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=44596&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=44596&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=44596&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=44596&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=44596&r=dst IIS Stability: http://bugs.php.net/fix.php?id=44596&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=44596&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=44596&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=44596&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=44596&r=mysqlcfg