How do I get my wordpress installation to use and recognize the most current version of PHP that I have installed on my droplet?

I have two droplets running ubuntu and apache, both with wordpress installed. One is a production site and one is a staging site. I have both droplets updated with php7.4 (shows php7.4 when I run “php -v”). However, only the staging site wordpress updated to use php7.4. The production site wordpress is still using php7.2. I did not do anything differently on the two when installing or trying to update. Is there a way to “force” wordpress to use a specific PHP version? Thanks!


Submit an 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.

Hi there @todderik,

Depending on whether you are using Nginx or Apache, you would need to update your virtual host config for your website and change the location to the PHP FPM socket so that it matches the PHP version that you are using.

Note that you need to make sure that the PHP FPM service for the new PHP version is running, then update the config, and finally restart Nginx or Apache.

Regards, Bobby