• Skip to main content
  • Skip to primary sidebar
  • Home
  • WordPress
  • web Hosting
  • linux
  • mysql
  • nginx
  • apache2
  • devops

Raju Ginni

wordpress tutorials seo hosting etc

You are here: Home / nginx server tutorials (installation, configuration, performance tuning, security) / upgrade php fpm ubuntu nginx 7.4 to 8.2

upgrade php fpm ubuntu nginx 7.4 to 8.2

Table of Contents

Toggle
  • upgrade php7.4 to 8.2 ubuntu
  • Configuring php 8.o for nginx
  • Configuring php 8.2 for nginx
  • Configuring listening socket or Port for php 8.2 fpm
  • Update php ini values in php 8 folder
  • check which fpm manager running
  • Uninstall/Remove PHP 7.x and Extensions
  • Monitor errors in the nginx log

upgrade php7.4 to 8.2 ubuntu

its better install php  8.0   and remove 7.4 or change to socket from tcp.

Latest php version

as of now php8.2

 

List php 7.4 extensions

dpkg -l | grep php7.4

 

Install php 8

in ubuntu 20/04 LTS default php installation is php 8

add repo

sudo add–apt–repository ppa:ondrej/php

or

sudo LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php

and update

 

sudo apt-get update &&  sudo apt-get install php8.0-fpm

or

sudo apt-get update &&  sudo apt-get install php8.2-fpm

 

sudo apt install php8.0-common php8.0-mysql php8.0-xml php8.0-xmlrpc php8.0-curl php8.0-gd php8.0-imagick php8.0-cli php8.0-dev php8.0-imap php8.0-mbstring php8.0-opcache php8.0-soap php8.0-zip php8.0-intl -y

 

php -v
PHP 8.0.27 (cli) (built: Jan 6 2023 15:27:43) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.27, Copyright (c) Zend Technologies
with Zend OPcache v8.0.27, Copyright (c), by Zend Technologies

root@ubuntu-s-2vcpu-4gb-intel-blr1-01:/etc/php# php -v
PHP 8.2.1 (cli) (built: Jan 6 2023 15:18:18) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.1, Copyright (c) Zend Technologies
with Zend OPcache v8.2.1, Copyright (c), by Zend Technologies

root@ubuntu-s-2vcpu-4gb-intel-blr1-01:~#

Configuring php 8.o for nginx

  1. Delete the default PHP 8.0 worker pool configuration.
    $ sudo rm /etc/php/8.0/fpm/pool.d/*
    
  2. Copy the configuration from PHP-FPM 7.4 to PHP-FPM 8.0.
    $ sudo cp -rL /etc/php/7.4/fpm/pool.d/* /etc/php/8.0/fpm/pool.d/

 

Configuring php 8.2 for nginx

Delete the default PHP 8.2 worker pool configuration.

$ sudo rm /etc/php/8.2/fpm/pool.d/*

Copy the configuration from PHP-FPM 7.4 to PHP-FPM 8.2.

$ sudo cp -rL /etc/php/7.4/fpm/pool.d/* /etc/php/8.2/fpm/pool.d/

 

Configuring listening socket or Port for php 8.2 fpm

/etc/php/8.2/fpm/pool.d/www.conf

my case If the old socket is 127.0.0.1:9000: same with nginx config file

Update php ini values in php 8 folder

/etc/php/7.4/fpm/php.ini, then copy those settings to the main PHP 8.0 configuration file /etc/php/8.0/fpm/php.ini.

 

Php ini values

max_execution_time

memory_limit

post_max_size

upload_max_filesize

date.timezone

 

 

memory_limit = 256M

max_execution_time   my case 300s or 5 minutes
upload_max_filesize  65MB 

 

Verify new php 8.2 confugration

 

 

sudo php-fpm8.2 -t

root@ubuntu-s-2vcpu-4gb-intel-blr1-01:~# sudo php-fpm8.2 -t
[12-Jan-2023 09:41:57] NOTICE: configuration file /etc/php/8.2/fpm/php-fpm.conf test is successful

reload php 8.2 apply changes

sudo systemctl reload php8.2-fpm.service

do not enable on start up if we keep them.

sudo systemctl disable –now php7.4-fpm.service

sudo systemctl disable –now php8.0-fpm.service

check which fpm manager running

ps aux | grep php

root@ubuntu-s-2vcpu-4gb-intel-blr1-01:~# ps aux | grep php
root 6531 0.0 0.3 239560 13368 ? Ss 2022 3:22 php-fpm: master process (/etc/php/7.4/fpm/php-fpm.conf)

 

finally start the php 8.2 service

sudo systemctl stop php7.4-fpm.service && sudo systemctl start php8.2-fpm.service

root@ubuntu-s-2vcpu-4gb-intel-blr1-01:~# ps aux | grep php root 831891 0.6 0.6 216160 25332 ? Ss 09:53 0:00 php-fpm: master process (/etc/php/8.2/fpm/php-fpm.conf)

Uninstall/Remove PHP 7.x and Extensions

 

or keep it as backup change tcp port listening socket

/var/run/php/php7.4-fpm.sock  or

127.0.0.1:9001

To uninstall PHP 7.x and all of its extensions, run the command below.

 

Monitor errors in the nginx log

 

tail -f /var/log/nginx/error.log

Note: WordPress plugins & themes need to update their php scripts according to php8.1  (check new features & fixes) new version prone to  bugs.

sudo apt-get purge php7.*


E: The repository 'http://ppa.launchpad.net/certbot/certbot/ubuntu focal Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.

Primary Sidebar

nginx server tutorials (installation, configuration, performance tuning, security)

  • Letsencrypt SSL Installation on apache/Nginx ubuntu / debian wordpress
  • fix error 520 522 524 on cloudflare wordpress godaddy nginx etc
  • nginx fastcgi cache wordpress how to configure
  • install LEMP Stack on 22.04 LTS Nginx MySQL PHP fpm #wordpress #digital ocean
  • Apache vs nginx (connection handling, modules, memory usage)
  • Pagespeed module install, configure, monitor, errors ft nginx &apache
  • nginx errors (504,502, 413, unable to start, syntax errors)
  • nginx conf explained best config file performance tuning tips nginx.conf location errors tutorial
  • use nginx as reverse proxy and load balancer for apache wordpress
  • nginx rewrite rules with examples 301 redirection
  • nginx modules list (enable, disable, upgrade, install dynamic module)
  • php fpm pool manager configuration settings based on server spike high cpu wordpress
  • php fpm restart nginx ubuntu enable status page, monitor etc
  • what is TTFB & how to Reduce it (server response time) Google pagespeed
  • letsencrypt install configure on ubuntu / debian nginx
  • Top 10 tips to improve nginx server security
  • nginx performance tuning connections, buffers file descriptors
  • enable brotli compression nginx brotli vs gzip
  • nginx installation on ubuntu 20.04 LTS
  • monitor nginx request with nginx status amplify datadog new relic
  • SSL faster reduce TLS hand shake improve https performance
  • nginx rate limiting explained by location time specific url
  • datadog nginx integration installation process
  • newrelic nginx integration process and errors fix and metrics
  • php fpm seems busy fixed warning and max children reached to handle max connections / requests
  • Php fpm configuration for 1000 concurrent connections server busy max children reached
  • php fpm ondemand vs dynamic vs Static (the dynamic pool problem)
  • nginx upstream response is buffered to a temporary file
  • php fpm install ubuntu 20.04 nginx
  • install phpmyadmin ubuntu nginx 22.04
  • upgrade php fpm ubuntu nginx 7.4 to 8.2
  • nginx add last modified header (remove, php wordpress)
  • php fpm dynamic pool manager settings
  • nginx fastcgi cache purge
  • nginx open file limit connections ulimits sysctl
  • php fpm high cpu usage WordPress 4 solutions nay work for you
  • nginx buffer size for wordpress
  • Cloudflare error code 524 nginx a timeout error occured
  • server configuration for 1000 concurrent users

hi i am raju ginni, primalry i manage wordpress websites on GCP cloud platform as a cloud engineer, and create content on passionate things.
you can follow me on youtbe

© 2025 - All Rights Reserved Disclaimer & Privacy Policy