php 8.1 full install ubuntu

sudo apt update
sudo apt install --no-install-recommends php8.1
php -v

sudo apt install php8.1-fpm
sudo a2enconf php8.1-fpm
sudo apt-get install php8.1-PACKAGE_NAME
sudo apt-get install -y php8.1-cli php8.1-common php8.1-mysql php8.1-zip php8.1-gd php8.1-mbstring php8.1-curl php8.1-xml php8.1-bcmath

This command will install the following modules:

  • php8.1-cli – command interpreter, useful for testing PHP scripts from a shell or performing general shell scripting tasks
  • php8.1-common – documentation, examples, and common modules for PHP
  • php8.1-mysql – for working with MySQL databases
  • php8.1-zip – for working with compressed files
  • php8.1-gd – for working with images
  • php8.1-mbstring – used to manage non-ASCII strings
  • php8.1-curl – lets you make HTTP requests in PHP
  • php8.1-xml – for working with XML data
  • php8.1-bcmath – used when working with precision floats
php -m
NOTICE: Not enabling PHP 8.1 FPM by default.
NOTICE: To enable PHP 8.1 FPM in Apache2 do:
NOTICE: a2enmod proxy_fcgi setenvif
NOTICE: a2enconf php8.1-fpm
NOTICE: You are seeing this message because you have apache2 package installed.
Processing triggers for libapache2-mod-php8.1 (8.1.9-1+ubuntu18.04.1+deb.sury.or                                                                                        g+1) ...

If wordpress website not working

sudo a2disconf php8.1-fpm
sudo a2dismod php7.4
sudo a2enmod php8.0
  
sudo service apache2 restart


Leave a Reply