What to do after Ubuntu upgrade to get WordPress site work again?

Assuming a standard wordpress installation using nginx server, here are the steps to keep wordpress running after upgrading Ubuntu.

1. Edit nginx config file:

sudo vim /etc/nginx/sites-available/{YOUR_SITE}

and modify the line:

fastcgi_pass unix:/run/php/php7.2-fpm.sock;

with correct version of php7.x-fpm.sock (should be one higher than the one in nginx). If you don’t know the version of php-fpm use this command to find out:

sudo apt list --installed | grep php

and look for php<version>-fpm.

2. Install php libraries which were removed as obsolete.

PHP_VERSION=7.2

sudo apt-get install php$PHP_VERSION-cli php$PHP_VERSION-cgi php$PHP_VERSION-fpm php$PHP_VERSION-mysql

PHP_VERSION should be the same in the one in nginx config file.

3. Restart php$PHP_VERSION-fpm:

sudo systemctl restart php7.2-fpm.service

4. Restart nginx:

sudo systemctl restart nginx.service

 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.