Administrators: Don’t get blind-sided by PHP 5.4’s CLI web server!
I’ve gone over a similar issue like this before regarding the likes of git/hg. While those are developer tools and are less likely to be present on a production machine.
PHP 5.4 is jumping on the bandwagon to include a ‘cute’ little internal server – which is enabled by default.
The ‘everything needs a standalone server’ thing is starting to
get on my security nerves feel silly.
It has limited use, and most developers will have limited use for it due to it’s lack of mod_rewrite (and equiv.) behavior … The worse part is: You can’t disable it if you want to keep cli (e.g.: no pear!)
Wish I spoke up on the list!
Anywho, here’s a hob-knobbed patch (for PHP 5.4.0RC6) that will change that for you.
(GNU/*nix only!) The patch adds a new configure option ‘–disable-cli-server’.
Download the patch here: patch-php5.4.0RC6-no-cli-server.diff
Place it in the PHP source base directory.
tar -zxvf PHP-5.4.0.RC6.tar.gz<br />cd PHP-5.4.0.RC6/ <br />patch -p1 < foo.patch<br />./buildconf --force<br />./configure [config options, etc] --enable-cli --disable-cli-server<br />make # (-jX if you've got spares ;) )<br />
In the future I’ll plan on formalizing this patch and propose it in php.internals when I get a chance to make the windows part of the patch.