LNMP一键脚本命令行升级LNMP最新版本、MySQL、PHP、Nginx 实现LNMP一键脚本升级,更新MySQL、PHP、Nginx

   谷歌SEO    
The upgrade command line method for upgrading the latest version of LNMP, MySQL, PHP, and Nginx is as follows: 1. Backup your website data and configuration files. 2. Use the following command to upgrade LNMP: ``` sudo apt-get update && sudo apt-get upgrade -y sudo apt-get install nginx php7.4-fpm php7.4-mysqlnd php7.4-mbstring php7.4-xml php7.4-zip php7.4-gd php7.4-curl php7.4-intl php7.4-bcmath php7.4-json php7.4-opcache php7.4-soap curl mariadb-server mariadb-client libmariadb3 libmysqlclient-dev ``` 3. Restart Nginx and PHP services: ``` sudo service nginx restart sudo service php7.4-fpm restart ``` 4. Check if the new version of LNMP has been successfully upgraded: ``` nginx -v php -v mariadb -V ``` 5. If you need to upgrade MySQL, please refer to the official documentation for the operation.

Upgrading LNMP via one-click script command line to the latest version of LNMP, MySQL, PHP, and Nginx

How to Upgrade LNMP to the Latest Version

1. Log in to the command line interface of the server.

Command Line Upgrade LNMP

2. Run the following command to back up the current LNMP configuration files and website data:

``` cp /etc/nginx/nginx.conf /etc/nginx/nginx.conf.bak cp /etc/php.ini /etc/php.ini.bak cp /etc/phpfpm.d/www.conf /etc/phpfpm.d/www.conf.bak cp -r /var/www/html/* /var/www/html_backup/ ```

Updating System Software Package List

3. Update the system software package list:

``` yum update ```

4. Install the latest version of LNMP software packages:

``` yum install -y http://lnmp.org/install.sh ```

5. Run the one-click script to install and configure LNMP:

``` yum install -y lnmp && lnmp start ```

6. Wait for the installation to complete, which may require entering some confirmation information.

7. Check if LNMP has been successfully upgraded to the latest version:

Check Nginx version: nginx -v

Nginx Version

Check PHP version: php -v

Check MySQL version: mysql -V

8. To stop LNMP services, use the following command:

``` lnmp stop ```

9. To restart LNMP services, use the following command:

``` lnmp restart ```

10. To reload Nginx configuration, use the following command:

``` nginx -s reload ```

11. To reload PHP configuration, use the following command:

``` phpfpm reload ```

12. To reload MySQL configuration, use the following command:

``` mysql_secure_installation reconfigure ```

Upgrade LNMP

Upgrade MySQL, PHP, Nginx to the Latest Version (Manual Method)

1. Upgrade MySQL:

Download the latest version of the MySQL installation package.

Stop the MySQL service: systemctl stop mysqld.

Uninstall the old version of MySQL: yum remove mysql-community-server.

Install the latest version of MySQL: Follow the installation instructions in the package.

Start the MySQL service: systemctl start mysqld.

Set root password and other security options.

2. Upgrade PHP:

Download the latest version of the PHP installation package.

Stop the PHP FPM service: systemctl stop php-fpm.

Uninstall the old version of PHP: yum remove php*.

Install the latest version of PHP: Follow the installation instructions in the package.

Start the PHP FPM service: systemctl start php-fpm.

3. Upgrade Nginx:

Download the latest version of the Nginx installation package.

Stop the Nginx service: systemctl stop nginx.

Uninstall the old version of Nginx: yum remove nginx.

Install the latest version of Nginx: Follow the installation instructions in the package.

Start the Nginx service: systemctl start nginx.

4. Check if the new version of the software is functioning correctly. You can verify by accessing a test page or running some simple PHP code. If you encounter any issues, please refer to the relevant documentation or seek help.

Thank you for reading. Feel free to leave a comment, follow for more updates, and like if you found the information helpful. Thank you for your attention.

评论留言

我要留言

欢迎参与讨论,请在这里发表您的看法、交流您的观点。