This section holds common questions about the way to install PHP. PHP is available for almost any OS (except maybe for MacOS before OSX), and almost any web server.
To install PHP, follow the instructions in Installarea şi configurarea.
- Why shouldn't I use Apache2 with a threaded MPM in a production environment?
- Unix/Windows: Where should my php.ini file be located?
- Unix: I installed PHP, but every time I load a document, I get the message 'Document Contains No Data'! What's going on here?
- Unix: I installed PHP using RPMS, but Apache isn't processing the PHP pages! What's going on here?
- Unix: I installed PHP 3 using RPMS, but it doesn't compile with the database support I need! What's going on here?
- Unix: I patched Apache with the FrontPage extensions patch, and suddenly PHP stopped working. Is PHP incompatible with the Apache FrontPage extensions?
- Unix/Windows: I have installed PHP, but when I try to access a PHP script file via my browser, I get a blank screen.
- Unix/Windows: I have installed PHP, but when try to access a PHP script file via my browser, I get a server 500 error.
- Some operating systems: I have installed PHP without errors, but when I try to start apache I get undefined symbol errors: [mybox:user /src/php4] root# apachectl configtest apachectl: /usr/local/apache/bin/httpd Undefined symbols: _compress _uncompress
- Windows: I have installed PHP, but when I to access a PHP script file via my browser, I get the error: cgi error: The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:
- Windows: I've followed all the instructions, but still can't get PHP and IIS to work together!
- When running PHP as CGI with IIS, PWS, OmniHTTPD or Xitami, I get the following error: Security Alert! PHP CGI cannot be accessed directly..
- How do I know if my php.ini is being found and read? It seems like it isn't as my changes aren't being implemented.
- How do I add my PHP directory to the PATH on Windows?
- How do I make the php.ini file available to PHP on windows?
- Is it possible to use Apache content negotiation (MultiViews option) with PHP?
- Is PHP limited to process GET and POST request methods only?
Why shouldn't I use Apache2 with a threaded MPM in a production environment?
PHP is glue. It is the glue used to build cool web applications by sticking dozens of 3rd-party libraries together and making it all appear as one coherent entity through an intuitive and easy to learn language interface. The flexibility and power of PHP relies on the stability and robustness of the underlying platform. It needs a working OS, a working web server and working 3rd-party libraries to glue together. When any of these stop working PHP needs ways to identify the problems and fix them quickly. When you make the underlying framework more complex by not having completely separate execution threads, completely separate memory segments and a strong sandbox for each request to play in, feet of clay are introduced into PHP's system.
If you feel you have to use a threaded MPM, look at a FastCGI configuration where PHP is running in its own memory space.
And finally, this warning against using a threaded MPM is not as strong for Windows systems because most libraries on that platform tend to be threadsafe.
Unix/Windows: Where should my php.ini file be located?
By default on Unix it should be in /usr/local/lib which is <install-path>/lib. Most people will want to change this at compile-time with the --with-config-file-path flag. You would, for example, set it with something like: