When older versions of PHP contain vulnerabilities, or when certain programs require newer versions of PHP, we need to upgrade the PHP version. This article teaches you how to upgrade the PHP version on your server.
Method for Upgrading PHP with LNMP One-Click Package
If you are using
LNMPone-click package, the method to upgrade the PHP version is as follows: First, log in via SSH and switch to the LNMP installation package 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 may be temporarily inaccessible. Once the upgrade is complete, it will be available again. If you have previously installed PHP-related components, you 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 with Baota Panel
There are two methods for upgrading the PHP version with Baota Panel. Method 1: Directly select the new version of PHP in the Baota 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.