LNMP one-click package environment upgrades PHP version to solve Multipart/form

888u

Last update at :2024-06-18,Edit by888u

There must be many users of Junge’s LNMP one-click package environment. It is currently a relatively easy-to-use environment package software for one-click deployment of NGINX website environments. The only shortcoming is that a lot of software is installed by default, resulting in some performance not being very good. A good VPS takes longer to install. The content is somewhat similar to the "AMH4.2 panel upgrade PHP patch to solve the Multipart/form-data vulnerability problem" shared by Snail yesterday. It also upgrades the PHP version. I saw that Brother Jun on the LNMP official forum gave an upgrade method, here The snails are sorted out for easy sharing.

Similarly, before upgrading the PHP version or recompiling the current PHP version, we need to back up the data so that the data can be restored in case of an error. Because Snail has done several tests before writing this article, and they are all OK. However, some users have reported on their forums that the website has problems after the upgrade, so the data needs to be backed up.

First, upgrade the PHP version

The PHP version can be directly upgraded in the LNMP system file. We can upgrade the current 5.2 or 5.3 to a higher-level PHP version. For example, when Snail demonstrated here, he upgraded 5.3.28 to 5.6.9.

A – Log in to SSH and execute the upgrade script

./lnmp1.1-full/upgrade_php.sh

After executing the script, we can see the above interface, enter the version we need to upgrade, and then press any key to perform the installation.

B – PHP upgrade installation completion check

Compiling PHP will take some time, we need to wait.

Seeing such an interface, PHP in LNMP has been upgraded. We can go to phpinfo to see if it is the latest upgraded version.

Second, patches for existing PHP versions

Because many times our website environment requires a special PHP version to support, and some components are based on a certain version. If upgraded, it will cause failure, so many times we still want to use the current version, then use patches. upgrade.

A – PHP5.2 patch upgrade

Find patch -p1

wget https://soft.laozuo.org/scripts/php-5.2-multipart-form-data.patchpatch -p1

B – PHP5.3 patch upgrade

Find the line cd php-$php_version/ and add it below

wget https://soft.laozuo.org/scripts/php-5.3-multipart-form-data.patchpatch -p1

Then merge line 42 to line 45

         if [ \\”$php_version\\” == \\”$old_php_version\\” ]; thenecho \\”Error: The upgrade PHP Version is the same as the old Version!!\\”exit 1fi< /p>

Line of code deleted.

We need to modify the method corresponding to the lnmp1.1-full/upgrade_php.sh upgrade file based on the current system version above (if you don’t know the current version, enter php -v to check, or drop a phpinfo into it), and edit the file Then upgrade the version. When entering the version number, enter the current system PHP version number to update the patch.

Recommended site search: Wanwang domain name registration official website, free website space application, .net space, vps foreign server, Taiwan server, US host rental, permanent free linux server, dual-line space, Wanwang free domain name, cn domain name registration ,

LNMP one-click package environment upgrades PHP version to solve Multipart/form

All copyrights belong to 888u unless special state
取消
微信二维码
微信二维码
支付宝二维码