WordPress Setup

back

I have a server running Ubuntu 20.04, so I thought it would be pretty standard to get a WordPress instance up and running. It took a couple of hours to get the site basically running, and then a few more to understand how to edit the structure and what themes bring to the party.

I wanted to use Nginx as I already had it installed, and because I was trying to learn a bit about it. I normally use apache for this sort of thing, so I thought it would be worth a try

To install WordPress I followed the guide on the Ionos website. It’s pretty solid and nearly got everything up and running. See my notes below for some issues.

https://www.ionos.co.uk/digitalguide/hosting/blogs/wordpress-nginx

There are some handy commands for Nginx on the Nginx beginners guide page. The main command I was using was

nginx -s reload

Notes

PHP Version

Ubuntu 20.04 wants to install php7.4 and not php8.2 as per the guide. This didn’t seem to change the end system installed but it did mean the guide was referring to non-existent files.

I had to update the Nginx config for the website to to point to the correct socket for php

fastcgi_pass unix:/var/run/php/php7.4-fpm.sock

File Ownership

when updating the file ownership or the WordPress install, I couldn’t execute

sudo chown -R nginx: /var/www/html/example.com/
chown: invalid spec: ‘nginx:’

It turns out that there are different users depending on the installed system. Mine was using www-data as the user. This made the command above

sudo chown -R www-data: wordpress/

Site Health Warnings

The day after I installed WordPress and launched the console to see what to do next, I was greeted with some Site Health Warnings. Given I was running a vanilla install I was a bit surprised to see any issues let alone long a critical issue.

I decided to tackle the first error, with the rather ominous text

The optional module, curl, is not installed, or has been disabled.

I decided to give the first error to Perplexity, and it gave the reasonable suggestion that I install php-curl. So I decided to proceed with blind faith and follow the steps it gave me.

sudo apt-get install php-curl

Next it told me to update the php.ini file, but was a bit vague as to which one to update, so I updated the one I created to increase the max image size as part or WordPress Configuration. I added the following line:

extension=curl

Perplexity then went on to suggest I tested the configuration, but I was a bit pressed for time and lets face it this is a hobby site not a hospital system so I restarted nginx and went back to the Site Warnings section

Yay! The error was gone.

So I worked my way through the errors – for two of the errors I didn’t need to update the php.ini file. I’ve compiled the table below which gives the module name, the ubuntu command to install the component(s) required and the updates to my php.ini file.

Error ItemUbuntu Commandphp.ini line
curlsudo apt-get install php-curlextension=curl
domsudo apt-get install php-xmlextension=dom
imagicksudo apt-get install imagemagick php-imagick
mbstringsudo apt-get install php-mbstringextension=php_mbstring.dll
zipsudo apt-get install php-zipextension=zip
intlsudo apt-get install php-intl

After running through the list, the warnings were gone … to be replaced with new warnings. Small victories.