When older PHP versions contain vulnerabilities, or when certain programs require newer PHP versions, we need to upgrade the PHP version. This article teaches you how to upgrade the PHP version on your server.
Method to Upgrade PHP with LNMP One-click Installer
If you are using
LNMPthe one-click installer, the method to upgrade the PHP version is as follows: First, log in via SSH and switch to the lnmp installation directory. Run the following upgrade code
./upgrade.sh php
Go to http://www.php.net/downloads.php to get the version number, enter the version number, e.g., 7.3.11, press Enter, and press Enter again to confirm to start the upgrade. As shown in the figure below

During the upgrade process, the website will be temporarily inaccessible, and it will be available again once the upgrade is complete. If you have previously installed PHP-related components, you will need to reinstall them. After upgrading PHP, phpMyAdmin may become unusable; you need to upgrade phpMyAdmin to a version compatible with the PHP and MySQL versions. To revert to the original PHP, rename the directory under /usr/local/ oldphp log to php, and copy the file /usr/local/oldphp date/init.d.php-fpm.bak.date to the /etc/init.d/ directory, renaming it to php-fpm to restore.
Method for Upgrading PHP Version in Baota Panel
There are two methods to upgrade the PHP version in Baota Panel. Method 1: Directly select the new version of PHP in Baota's App Store for installation, then go to the website settings and switch the PHP version used by the website to the new one. Method 2: First, delete the old version of PHP, then install the new version of PHP from the App Store.
Comments are closed
The comment function for this article is closed. If you have any questions, please feel free to contact us through other channels.