

Sudo service apache2 restart Upgrade PHP 8.1 for Nginxįor Nginx you need to update the PHP-FPM socket in your Nginx configration located inside the sites-available directory. Restart Apache for the changes to take effect. Replace the current enabled PHP version with your version. Disable the old PHP module ( below I have mentioned php7.4, you need to use your current php version used by Apache) and enable the new PHP module using the following command. You need to tell Apache to use the PHP 8.1version we installed right now. Once you have installed PHP 8.1 you need to upgrade to the latest installed version of PHP. Prepare yourself for a role working as an Information Technology Professional with Linux operating system Now you are having PHP 8.1 Installed and configured. Once you have updated your PHP FPM settings you need to restart it to apply the changes. Hit CTRL+X and Y to save the configuration and check if the configuration is correct and restart PHP. If you want to change the username name you can change the following lines by replacing the www-data with your username. Sudo nano /etc/php/8.1/fpm/pool.d/www.conf PHP-FPM allows you to configure the user and group that the service will run under.

Sudo service php8.1-fpm restart Configure PHP 8.1 FPM Pools Once you have modified your PHP settings you need to restart your Apache for the changes to take effect.įor users with Nginx to who use PHP-FPM, you need to restart PHP-FPM.

Hit F6 for search inside the editor and update the following values for better performance. Now we configure PHP for Web Applications by changing some values in php.ini file.įor PHP 8.1 with Apache the php.ini location will be in following directory.įor PHP 8.1 FPM with Nginx the php.ini location will be in following directory.
#PHP SWITCH INSTALL#
Sudo apt install php8.1-common php8.1-mysql php8.1-xml php8.1-xmlrpc php8.1-curl php8.1-gd php8.1-imagick php8.1-cli php8.1-dev php8.1-imap php8.1-mbstring php8.1-opcache php8.1-soap php8.1-zip php8.1-redis php8.1-intl -y Configure PHP 8.1 Now, install some commonly used php-extensions with the following command. Installing PHP extensions are simple with the following syntax. ADVERTISEMENT php-fpm8.1 -v Install PHP 8.1 Extensions
