[quote]I’ve heard that PHP as CGI is significantly slower than as a module, yet the
knowledge base says otherwise. Is there something special going on to make
PHP running as a CGI is indeed slower, but the fact that you’re running it in a shared web hosting environment has more of an impact, really. Only heavily impacted sites will usually be able to tell the difference, as PHP binary execution times come more into play there.
[quote]And, if I were to compile my own PHP, would it still be just as fast?
It’s be about the same speed as our PHP/CGI binary, as you’d have to run it as a CGI as well.
Basically, for a variety of reasons mod_php just isn’t as well suited to a shared hosting environment as PHP/CGI. I would recommend simply trying both out and seeing if one or the other is noticeably fast or slow ‘enough’ to impact your specific purpose, and going from there. I personally use PHP/CGI on most of my own sites, as I honestly can’t tell much difference speed-wise and the other benefits of PHP/CGI are important enough to keep.
- Jeff @ DreamHost
- DH Discussion Forum Admin