Hey All,
My PHP version according to the console is:
PHP 7.3.26 (cli) (built: Jan 5 2021 16:37:31) ( NTS ) Copyright © 1997-2018 The PHP Group Zend Engine v3.3.26, Copyright © 1998-2018 Zend Technologies with Zend OPcache v7.3.26, Copyright © 1999-2018, by Zend Technologies
But in Wordpress it says: Server info: Apache/2.4.46 (Unix) OpenSSL/1.0.2g PHP version: 7.0.33 - We recommend using PHP version 7.2 or above for greater performance and security.
How do I get it to register the correct version?
I’m using Ubuntu 16.04.7 LTS (GNU/Linux 4.4.0-200-generic x86_64).
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!
Hi @tom57746c21d00f ,
You need to tell Apache/Nginx to use the newly installed PHP verson.
Apache
You need to tell Apache to use the installed version of PHP 7.3 by disabling the old PHP module and enabling the new PHP module using the following command.
sudo a2dismod php5.X
sudo a2enmod php7.3
Remember to change 5.X with your actual PHP version.
Restart Apache for the changes to take effect.
sudo service apache2 restart
Nginx
For Nginx you need to install FPM, execute the following command to install PHP 7.3 FPM
sudo apt install php7.3-fpm
After the installation has completed, confirm that PHP 7.3 FPM has installed correctly with this command
php-fpm7.3 -v
For Nginx you need to update the PHP-FPM socket in your Nginx configuration located inside the sites-available directory. This will be located inside the location block location ~ \.php$
sudo nano /etc/nginx/sites-available/your.conf
The line you need to modify will look like this…
fastcgi_pass unix:/run/php/php5.X-fpm.sock;
You need to replace the old PHP version with the new version.
fastcgi_pass unix:/run/php/php7.3-fpm.sock;
Regards, KFSys
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.