How Do You Install a PHP Engine on a Windows PC?


Quick Answer

In order to use PHP on a Windows computer, you must install and configure a web server. Apache is one commonly used option, which is available for download at apache.org. PHP is a server-side scripting language available for Windows download at windows.php.net.

Continue Reading
Related Videos

Full Answer

  1. Install Apache

    The Apache Web server is available for download at apache.org. Download the latest Windows version and run the installer. During the installation, Apache asks for domain name and domain name server addresses, if you are hosting the web server over the Internet, enter this information. However, if you are simply using Apache locally, input "localhost" (without the quotes) for both of these prompts. Follow the remaining instructions until the installation is complete.

  2. Install PHP

    The easiest method for installing PHP is to download and run a version with an executable installer. These versions will automatically configure your web server to properly use PHP. However, the newest versions of PHP commonly lack installers and must be manually installed. To do this, extract the PHP zip file to a folder such as "C:php"".

  3. Configure Apache to use PHP

    If installed PHP manually or before Apache was installed, you must configure Apache to use PHP. First, open the httpd.conf file. This is typically located in the Apache configuration folder at "C:Program FilesApache GroupApache2conf"" Add the following lines into this file: LoadModule php5_module "c:/php/php5apache2.dll" AddHandler application/x-httpd-php .php PHPIniDir "C:/php" If PHP is installed elsewhere, modify the folder paths within these lines accordingly. Restart Apache by opening the Windows Command Console and typing "httpd.exe -k restart". PHP is now ready for use.

Learn more about Computer Programming

Related Questions