In order to develop a WordPress Theme or Plugin we might want to be able to run it locally. That is necessary if you develop offline, have no Server at your disposal or want to see the changes you make instantly. Setting up a WordPress instance on Windows and Mac is pretty convenient, because you can use Software Bundles like WAMP and MAMP, which provide Apache, MySQL and PHP out of the box.

If you are using Arch Linux or a distribution based on it like Manjaro, this little tale of my installation Odyssey may be what you are looking for.

Starting out with nothing

We begin our journey with a fresh installation of Manjaro. Before we can start installing WordPress, we should install all the Software it depends on. Namely Apache, PHP and MySQL

Installing WordPress

The Tutorial provided by wiki.archlinux.org describes everything we need and more. Here is the gist:

1. Install the wordpress package:

run in Terminal:

pacman -S wordpress

2. Configure Apache

create File /etc/httpd/conf/extra/httpd-wordpress.conf with content:

Alias /wordpress "/usr/share/webapps/wordpress"
<Directory "/usr/share/webapps/wordpress">
	AllowOverride All
	Options FollowSymlinks
	Require all granted
</Directory>

edit the Apache configuration File /etc/httpd/conf/httpd.conf and add:

Include conf/extra/httpd-wordpress.conf

3. Restart Apache

run in Terminal:

sudo apachectl restart

4. Configure MySQL

Make sure that MySQL is running! To start it run in Terminal:

sudo systemctl start mysqld

Login as root, create a user and database:

mysql -u root -p
CREATE DATABASE wordpress;
GRANT ALL PRIVILEGES ON wordpress.* TO "root"@"localhost" IDENTIFIED BY "";
FLUSH PRIVILEGES;
EXIT

Achievements

Now that we have finished all the necessary installations and configurations. We are finally able to use WordPress at http://localhost/wordpress. All further configuration should be pretty straightforward.

Neoxn3il

I am a self taught programmer & a passionate software developer trying to build solutions to the world’s problems.

Neoxn3il Neilzblaze007


Published