Before you can install PHP, you must have a Web server installed and working in your system. Although PHP has support for most of the Web servers worth mentioning, Apache/PHP remains the most popular combination among developers.
The Apache HTTP server is distributed under the Apache License, a free software/open‑source license whose current version can be found on the Licenses page of the Apache website at: http://www.apache.org/licenses/.
You can download the Apache HTTP server from the download page of the Apache website at: http://httpd.apache.org/download.cgi.
Installing Apache is a very easy process. On Windows, if you have downloaded the version of Apache for Windows with the .msi
extension (the recommended way), you just run the Apache .msi
file and then follow the Wizard. On Unix-like systems, once you have downloaded a source version of the Apache HTTP server, you perform the standard operations that you normally deal with when it comes to installing new software from sources: extract, configure, compile, and install.
Once you have Apache installed and configured, you can start it. On Windows, Apache is normally run as a service. You can configure the service startup by choosing Automatic, Manual
, or Disabled
. On Unix-like systems, Apache, the httpd
program, is run as a demon. It is recommended that you use the apachectl
control script to invoke the httpd
executable:
# /usr/local/apache2/bin/apachectl start
To make sure that your Web server is up and running on your machine, open your Web browser to the URL: http://localhost/.
The following figure shows the default page of Apache Web server.
Now that you have your Web server up and running, you can move on to the next step, obtaining and installing PHP.