Højst mærkværdig fejl
Jeg har følgende to meget simple PHP filer:index.php:
-------------------------
<?
echo \"Ho! \";
echo `./test`;
?>
test:
-------------------------
#!/usr/local/bin/php -q
<?
echo \"Ha!\";
?>
Forventet output af index.php er \"Ho! Ha!\"
Det får man også ved at køre
/usr/local/bin/php -q < index.php
Men se lige hvad man får når man requester index.php igennem Apache:
Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html Ho! X-Powered-By: PHP/4.0.5 Content-type: text/html
... og den bliver ved.
Faktisk dør serveren næsten af det :(
Fakta:
OS: Testet med Linux 2.2 og FreeBSD 4.3
Apache: Testet med 1.3.9 og 1.3.19
PHP: 4.0.5 CGI mode --with-mysql --enable-force-cgi-redirect --with-gdbm --enable-ftp
Det er helt sort for mig.
