Skip to navigation
Installing PHP 8.1 for Debian 11 bullseye
02.12.21
Import & Install GPG key: The first step is to import and install the GPG key before adding the repository. To do this, use the following terminal (CTRL+ALT+T) command: sudo wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg Note, you may need to install these dependencies if you have trouble: sudo apt install apt-transport-https lsb-release ca-certificates Import & Install Repository: With the GPG key sorted, it is time to add the Ondřej Surý repository as follows: sudo sh -c 'echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list' Install PHP 8 Now you can proceed to install PHP 8 for your particular need as follows: Install Apache Module Option To install PHP 8 as an Apache module, enter the following command. sudo apt update && sudo apt install php8.0 libapache2-mod-php8.0 Once installation is complete, restart your Apache server for the new PHP module to be loaded. sudo systemctl restart apache2 Install Apache Module Option with FPM PHP-FPM (an acronym of FastCGI Process Manager) is a hugely popular alternative PHP (Hypertext Processor) FastCGI implementation. To install PHP-FPM for Apache 2, use the following commands. sudo apt update && sudo apt install php8.0-fpm libapache2-mod-fcgid Note, by default, PHP-FPM is not enabled for Apache. You must enable it by the following command. sudo a2enmod proxy_fcgi setenvif && sudo a2enconf php8.0-fpm Lastly, restart Apache. sudo systemctl restart apache2 Verify that PHP-FPM is working: sudo systemctl status php8.0-fpm
https://www.linuxcapable.com/how-to-install-php-8-on-debian-11-bullseye/
Reply
Anonymous
Information Epoch 1745689863
Data dominates.
Home
Notebook
Contact us