Basic Setup for Local WordPress Development
This is the quickest and easiest setup I know of for getting started developing in PHP and/or WordPress on my local machine.
When doing any local WordPress development, having PHP installed is useful for linting. But you do not need to install PHP when using Local. That is because Local comes bundlede with everything it needs to run a WordPress site.
Install PHP
Installing an entire web server creates more surface area for an attack or vulnerability. But I will need PHP to run certain scripts. For example scripts for linting. If you simply run apt install php
then apache2 web server will automatically be installed. Instead do the following to install php-cli
and an extra PHP module.
1
2
3
4
5
# Only install PHP for use on the commnad line.
sudo apt install php-cli
# Optional. Install any other needed PHP modules.
sudo apt install php-xmlwriter # for linting with PHPCS
Install Local by WP Engine (previously by Flywheel)
Now go tho the Local releases page, download Local, and install it.
1
2
3
4
sudo dpkg -i local-[version].deb
# You may still need to run apt if it didn't install properly.
# sudo apt --fix-broken install
Missing dependencies
If there were missing dependencies, you will very likely want get these missing deps from launchpadlibrarian.net. Take a look at the output and read carefully. Only get what you need. Things may have changed since writing this post.
1
2
3
4
5
6
7
# Get packages and install.
wget http://launchpadlibrarian.net/648013227/libncurses5_6.4-2_amd64.deb && sudo dpkg -i libncurses5_6.4-2_amd64.deb
wget http://launchpadlibrarian.net/648013231/libtinfo5_6.4-2_amd64.deb && sudo dpkg -i libtinfo5_6.4-2_amd64.deb
wget http://launchpadlibrarian.net/646633572/libaio1_0.3.113-4_amd64.deb && sudo dpkg -i libaio1_0.3.113-4_amd64.deb
# One more dep that is still in the repos.
sudo apt install libnss3-tools
Now try installing Local again, with sudo dpkg -i local-[version].deb
.