Step by Step procedure to update to latest PHP 8.3.11

NOTE

Please also read this comment before upgrading Step by Step procedure to update to latest PHP 8.3.11

  1. Add repository for PHP8.3.11 since ubuntu lts 22.04 wont update after 8.1.2
    sudo add-apt-repository ppa:ondrej/php
  2. Upgrade everything including installing PHP 8.3.11
    sudo apt upgrade
  3. Reboot
    sudo reboot
  4. Copy new php config to running
    sudo cp /etc/php/8.3/fpm/pool.d/www.conf /etc/php/8.3/fpm/pool.d/librenms.conf
  5. Edit librenms config
    change [www] to [librenms]
    change user and group from www-data → librenms
    sudo nano /etc/php/8.3/fpm/pool.d/librenms.conf
  6. Edit librenms config
    change [www] to [librenms]
    change user and group from www-data → librenms
    sudo nano /etc/php/8.3/fpm/pool.d/www.conf
  7. Restart php service
    sudo systemctl restart php8.3-fpm
  8. Check php service
    systemctl status php8.3-fpm.service
  9. Update nginx configuration and fastcgi_pass row to :
    sudo nano /etc/nginx/conf.d/librenms.conf
    fastcgi_pass unix:/run/php/php8.3-fpm.sock;
  10. Restart the nginx service
    sudo systemctl restart nginx
  11. Check the nginx service
    sudo systemctl status nginx
  12. Go to web and check with validate option
  13. Go to cli and with ./validate command
  14. If needed update the clocks with
    sudo timedatectl set-timezone [your timezone goes here]
    sudo dpkg-reconfigure -f noninteractive tzdata
    sudo systemctl restart mysql
    sudo nano /etc/php/8.3/fpm/php.ini
    (uncomment and change the field → date.timezone = [your timezone goes here])
    sudo nano /etc/php/8.3/cli/php.ini
    (uncomment and change the field → date.timezone = [your timezone goes here])
  15. Restart the service
    sudo systemctl restart php*-fpm.service
10 Likes

Thanks for the info …
i just upgrade to ubuntu 24 from 22.

Steps to upgrade almost same.

2 Likes

Hello friend,
i tries your procedure to my librenms server on Ubuntu 20.04.6 LTS but i stucked on your step 4. :frowning:
After reboot server i don’t have created folder with php 8.3 a i can’t copy new copy php config.
I agreed all after added command sudo apt upgrade

Thanks, this was a big help. Only issue I ran into was I still using Apache in Ubuntu 22, had to move over to nginx.

I am running Ubuntu 22.04 LTS. I added the repository and ran sudo apt upgrade but it did not install PHP 8.3.

Using FreeBSD I just threw all the php83 pkg names in a temp file and executed the pkg install against this file.

php83-composer
php83-curl
php83-dom
php83-fileinfo
php83-gd
php83-gmp
php83-mbstring
php83-mysqli
php83-pdo
php83-pdo_mysql
php83-pecl-json_post
php83-posix
php83-session
php83-simplexml
php83-snmp
php83-sockets
php83-tokenizer
php83-xml
php83-zip
php83-zlib

pkg install cat /tmp/pkglist

Then after a restart it was all done and nothing further I had to do. Now running 8.3.12

Is there a link to instructions for upgrading to [PHP 8.3.11] for CentOS9 and Apache?

1 Like

Hi.

Just tested everything again and it worked for me on 8.1.2 php install.
Looks like it did not install php 8.3.1x for you.
There is an confirmation required for you to accept the gpg key and repository being added.
After that confirmation it will install latest php from newly added repo.

I was able to install PHP 8.3 manually and then continue with the steps. Up and running now, much obliged.

Hmm, for the reasons unknown it seems that system wont fetch the php8.3.12 as of now via sudo apt upgrade command.
For me it works on multiple machines and I made the instructions based on that.
I did not encounter the refusal of the PC or VM to install php8.3.x with sudo apt upgrade command.
It would be cool if you could share stdout of the apt just to see where it fails, ie why doesn’t install php8.3.x automatically.

All the Best

I’m running LibreNMS on Oracle Linux 9.4 and originally followed this guide to install:
LibreNMS Monitoring Server - Documentation (rockylinux.org)

If you’ve installed LibreNMS using the above guide, then following the guide below works well for upgrading your PHP version to 8.3:

Easy PHP 8.3 Installation on AlmaLinux 9 / Rocky Linux 9: A Comprehensive Tutorial | by Jack Nothan | Medium

Hope this helps someone!

2 Likes

This worked for me when upgrading to Ubuntu 24.04

Thank you for this. I had no idea how to do this and appreciate it. Worked perfectly on Ubuntu 22.04.

FYI, not stopping the dispatcher is causing polling with the wrong timezone set. Setting the “last_polled” time in the future and effectively pauses polling for hours.

You can reset last_polled with this command:
lnms tinker --execute="\App\Models\Device::query()->update(['last_polled' => null])"

Note: this is not an issue if you are using the cron based polling

1 Like

Everything seemed to work until I got to the nginx restart and I get a “Failed with result ‘exit-code’” error.
Any ideas?

1 Like

updated to 24.04 and everything is working! Thanks

Worked perfectly here. Thanks for putting this together for us newbies. Super helpful!

Does this mean upgrading ubuntu from version 20 to 24?

you can upgrade only php. I did that on a 22.04.

After upgrading to 22.04 my Nginx could still not run