PHP and Apache 2.0
31st March 2004
For as long as Apache 2 has been stable, the PHP manual has carried this strongly worded warning:
Do not use Apache 2.0 and PHP in a production environment neither on Unix nor on Windows.
I’ve frequently wondered why they are being so slow to support the new version —after all, Apache 2 provides a bunch of improvements over the older 1.3 and is recommended by the Apache Software Foundation as the best available version
.
I finally found the answer today in this comment buried on Slashdot. It seems that one of the key features of Apache 2 is the new threaded worker module which uses threads to serve more requests more efficiently than 1.3’s multi-process based server. While the core Zend engine of PHP is thread-safe many of the critical libraries that PHP relies on for its advanced functionality (image processing, database connectivity and so forth) are not, and are unlikely to become so any time in the future. In a threaded environment PHP is likely to suffer from all kinds of unpredictable bugs. Apache 2 can be run in traditional 1.3-style prefork mode but doing so greatly reduces its advantages over 1.3. Combined with the lack of heavy duty testing on Apache 2 and the fact that the 1.3 series will continue to be supported for a long time to come it’s clear why the PHP team are unwilling to recommend PHP and Apache 2 in a production environment.
More recent articles
- Weeknotes: Llama 3, AI for Data Journalism, llm-evals and datasette-secrets - 23rd April 2024
- Options for accessing Llama 3 from the terminal using LLM - 22nd April 2024
- AI for Data Journalism: demonstrating what we can do with this stuff right now - 17th April 2024
- Three major LLM releases in 24 hours (plus weeknotes) - 10th April 2024
- Building files-to-prompt entirely using Claude 3 Opus - 8th April 2024
- Running OCR against PDFs and images directly in your browser - 30th March 2024
- llm cmd undo last git commit - a new plugin for LLM - 26th March 2024
- Building and testing C extensions for SQLite with ChatGPT Code Interpreter - 23rd March 2024
- Claude and ChatGPT for ad-hoc sidequests - 22nd March 2024
- Weeknotes: the aftermath of NICAR - 16th March 2024