How to setup WordPress locally: Installing PHP

Published on

Last Updated on

Estimated Reading Time: 1 min

Installing PHP on Windows

  • Go to the PHP website and download the zip file.
  • Make sure the zip file contains the dll for the correct version of the Apache.
  • Extract the zip file to a location that 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_ php5module “[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.