How to set up local WordPress Development Environment
WordPress like other website development software requires a server to function. The popular ones out there are XAMPP & WAMP for windows and LAMPP for Linux. In this tutorial I will walk you through installing XAMPP for windows. The steps are almost similar for both so whichever you are installing you are good.
- Download the XAMPP installer from Bitnami website. There are 2 versions (5 and 7) these are basically the PHP versions of the server. WordPress recommends v7 with the possibility of enforcing it by 2020. There are old themes that will not work on v7 and there are new themes that will not work on v5, so to be on the safe side download v7 and use updated themes.
- Double click the installer and direct it to install in C:\xampp and agree to all
- After the installation you can select to start the XAMPP control panel
The installer does not put a shortcut to the control panel in your desktop so follow this steps to have it close by.
- In file explorer go to C:\xampp and locate the xampp-control.exe file
- Double click to start it
- Right click on the icon in your taskbar and select pin to taskbar
This keeps it in your taskbar even after closing it
After starting the control panel there are many buttons and controls but we are only interested in two of them, Apache & MySQL the first two buttons on the left. Starting these two services starts the server and can be verified by going to ‘localhost’ in your browser.
To get WordPress running smoothly there are a few changes we need to make in the code of XAMPP files. This is basic so even muggles should be able to do this with ease.
We need to increase the maximum execution time of each script in seconds, maximum input time, maximum size of POST data and maximum allowed size for file uploads.
- In your XAMPP control panel click on the config on Apache line (first line) and select PHP (php.ini)
- This will open a text document, press Ctrl + F to search and write ‘max’ without the quotes and press enter.
- Keep pressing enter until you reach the maximum execution time line and edit max_execution_time=300 to max_execution_time=1000
- After that click on “Find Next” until you reach maximum input time and change max_input_time=300 to max_input_time=1000
- Next click on “Find Next” until you reach maximum size of POST data and change post_max_size=2M to post_max_size=200M
- Then click on “Find Next” until you reach maximum allowed size for file uploads and change upload_max_filesize=2M to upload_max_filesize=200M
- Save the document and restart the server for the changes to take effect.