I have a WordPress install on a Ubuntu (18.04.1) droplet. WordPress site health thinks I have PHP 7.0.33. Doing php -v in terminal indicates I have PHP 8.1.13 (built today it was showing 8.1.5 before I updated).
I cannot figure out how to kick WordPress in the nuts to make it realize it has access to the right version.
I’m not sure if I have two versions of PHP running (nor how to check, TBH).
I’ve been looking for tutorials and information on DO and elsewhere the whole morning and am coming up empty.
Any help would be greatly appreciated.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.
This promotional offer applies to new account only.
Hi @vavroom,
I did notice something else on your Post. You’ve marked the Ubuntu 18.04. If you are still using it, I’ll strongly recommend upgrading to the newest version as soon as possible.
Hi @vavroom,
Yes, you have two or possibly more PHP versions. Anyway, you need to tell your WebService (Apache/Nginx) what PHP version to use.
First disable the current PHP version
Now enable the one you want
Set PHP 8 as default version using command:
Alternatively, you can run the following command to set which system wide version of PHP you want to use by default.
Finally, restart your Apache web server:
Apart from the update-alternatives commands the others were for Apache. If you are using Nginx, you need to edint your nginx config file for your website and change the php version it uses there:
In there find the php block:
See the fastcgi_pass? Change the PHP from /run/php/php7-fpm.sock; to /run/php/php8.1-fpm.sock;