Testing Wordpress Locally: Installing PHP

This entry was posted on
  • Tutorial
  • Wordpress

The Series

  1. Installing a Web Server (Apache)

  2. Installing PHP

  3. Installing MySQL

  4. Installing phpMyAdmin

  5. Installing Wordpress

Installing PHP on Windows

  • Go to the PHP website and download the zip file.

  • Make sure the zip file contains the dll for the right version of the apache.

  • Extract the zip file to a location which does not contain spaces.

Configuring APACHE for PHP

Open httpd.conf for editing. You can access this file through the menu at Start -> Programs -> Apache HTTPD Server -> Configure Apache Server -> Edit the Apache httpd.conf File

  • Configure Apache to load the PHP module.

    • Find the LoadModule section.

    • Add the following line to LoadModule php5_module[path to php5apache2_4.dl in the PHP folder]”. This would be something Like “D:/Softwares/php/php5apache2_4.dll”. Make sure that you use forward slashes.

  • Configure Apache to recognize PHP extensions.

    • Find the AddType section.

    • Add the following line AddType application/x-httpd-php .php

  • Restart the APACHE server.

If you see errors, check the Apache error.log

Configuring PHP

  • Copy php.ini to the Windows directory.

  • Open php.ini for editing.

  • Set your local timezone.

    • Find this line; date.timezone = and remove the semicolon in front of it.

    • Find the timezone code from Php timezones and add the code for the timezone after the = sign.

  • Restart the APACHE server.