Php 8.1 install ubuntu11/13/2023 As always, feedback, likes and retweets are welcome. Check out the links below to have additional information related to the post. I'll edit this blog post for each new PHP minor version. It forces me to update my websites regularly, so that they can run on a recent PHP version. Since then, from time to time, I have applied new updates. I've got my server since 2016 at the time it was an Ubuntu 16.04 LTS running PHP 7.2. Upgrading PHP with the ondrej/php ppa is straightforward. With Zend OPcache v8.2.5, Copyright (c), by Zend Technologies Conclusion Zend Engine v4.2.5, Copyright (c) Zend Technologies Now, check that the CLI has the correct PHP version : Sudo apt install php8.2- Install the Apache module for PHP 8.1 apt install libapache2-mod-php8.2 Deactivate the Apache module for PHP 8.0 a2dismod php8.1 Activate the Apache module for PHP 8.1 a2enmod php8.2 Select the new PHP alternative update-alternatives -config php We can install all of them in a single command. Take the missing packages from the previous step, replace them in the following command, and then run it. Install missing packages for the new version Php8.1-zip/bionic,now 8.1.18-1+ubuntu18.04.1++1 amd64 ĭo the same for the new version, compare both and list missing ones. List the installed package for the current PHP version apt list -installed | grep php8.1 libapache2-mod-php8.1/bionic,now 8.1.18-1+ubuntu18.04.1++1 amd64 Exit without changing the version for now. We check that the version we want to migrate to is available. For example:ĭate.timezone = Europe/Paris Update apt sudo apt update Check the installed PHP alternatives update-alternatives -config php There are 3 choices for the alternative php (providing /usr/bin/php). We can check and save the most important parameters. Loaded Configuration File => /etc/php/8.1/cli/php.ini Locate the current php.ini file php -i | grep php.ini Configuration File (php.ini) Path => /etc/php/8.1/cli This list can be helpful in case of a problem. So we can compare it with the list related to the new PHP version with want to upgrade. Save the PHP extensions list currently installed So, I just have to make it before starting the migration. In my dashboard, I have an option to create a complete snapshot of the server. I have a VPS (Virtual Private Server) hosted on OVH. It should almost be a copy and past process. The goal is to have the exact steps, so we don't forget anything, and we are sure all will go smoothly. As you can see I use an old Ubuntu LTS release, but thanks to the ondrej/php ppa, we have access to all PHP versions that would otherwise be unavailable. I wanted a memo here on my blog, so I don't have to search again and again the steps to migrate efficiently without fearing breaking something. The last time I upgraded PHP on my server, I did it by looking at some random post on the Internet. The migration was done starting with the following versions:
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |