![]() # rm /etc/php/8.0/fpm/pool.d/*Ĭopy the old PHP configuration to the new one as follows. To configure the PHP 8.0 installation, delete the default PHP 8.0 Worker pool configuration. Once the steps are done, check for the Nginx configuration check. # sudo sed -i -follow-symlinks 's|||g' /etc/nginx/sites-enabled/default # sudo cp -L /etc/nginx/sites-enabled/* /etc/nginx/sites-backupĮdit the configuration file such that the socket name is replaced with the new socket name. The output is like this: /etc/nginx/sites-enabled/default is the configuration file that needs to be edited where /var/run/php/ is the socket.Ĭreate backup folder inside /etc/nginx path to save the existing configuration and copy the configuration files to the backup folder. # sudo grep -R fastcgi_pass /etc/nginx/sites-enabled/ | grep -Ev '#\s fastcgi_pass' To find the socket created by Old PHP-FPM and the Nginx configuration file that uses, execute the below command. This section will help to configure a socket for PHP-FPM 8.0 and reconfigure with Nginx with that socket. Currently, it is communicating with PHP-FPM 7.4 via the socket created by PHP-FPM 7.4. Now, the webserver needs to communicate with PHP-FPM 8.0 via the socket. We have managed to install PHP 8.0 on the Cloud servers. To check the PHP version after the installation, give the following command # php -v ![]() Users can try to install any custom modules with the PHP 8.0 version. In case if more modules are to be installed in PHP 8.0, the command method is given below as any modules/extensions can be installed for PHP 8.0 manually if requires. Save the list of current PHP 8.0 modules into a file. # apt -y install php8.0-cli php8.0-common php8.0-curl php8.0-fpm php8.0-gd php8.0-mbstring php8.0-mysql php8.0-opcache Now, install the PHP 8.0 Packages, here we do not simulate the package, but execute them. Please run the above command after removing the virtual php8.0-json package from the list of packages and run until the list has no virtual packages left. ![]() If the above error is shown, it means the package list contains a virtual package named php 8.0-json. You may get the following error while installing the packages: E Package 'php8.0-json' has no installation candidate # sudo apt -simulate install php8.0-cli php8.0-common php8.0-curl php8.0-fpm php8.0-gd php8.0-json php8.0-mbstring php8.0-mysql php8.0-opcache Once it is done, it requires simulating the installation of PHP 8.0 packages using the list generated earlier. Once it is done, it is advisable to run a repository update: # apt-get update # sudo LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php As a first step, it requires adding a repository ppa:ondrej/php. # php-fpm7.4 -m > ~/php-fpm7.4.modulesĪfter saving the modules, the next step is to install PHP 8.0 packages on the server. Save the existing PHP-FPM 7.4 modules into a file by executing the below command. The output shows the list of packages that are being generated for PHP Version 8.0. # dpkg -l | grep php7.4Įxecute the following command to generate a list of corresponding PHP 8.0 package. List all the PHP 7.4 packages on the server using the command. Log in to your server by using the SSH terminal. Steps to upgrade the version of PHP to 8.0 The database is very important and critical data that needs to be maintained with high integrity and consistency.Īssuming you have a Cloud Servers where the websites are being hosted with PHP version 7.4 as the highest version using LEMP stack or using NGINX. This guide outlines the basic steps to upgrade PHP v7.4 to PHP v8.0 on an Ubuntu20 server that already has NGINX, MySQL and PHP services running in it.ġ) Latest Snapshot/Templates of the Cloud Servers ensuring the source code and entire thing as backups.Ģ) Back up the website database as risk mitigation. It is also important that all the data in the server is backed-up before proceeding with the PHP upgrade. Before upgrading the PHP version in the server, it is important that you make sure that all the applications/websites hosted on the server are compatible with the newer version of PHP. It is necessary that PHP in a server is kept up-to-date with the latest version since the newer versions of PHP provide better security, improved performance for websites, and also several features and improvements from the older versions. PHP (Hypertext Preprocessor) is one of the most commonly used open-source scripting languages that can be easily incorporated into HTML code.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |