Ubuntu 20.04 php 8.18/14/2023 PHP Warning: PHP Startup: Unable to load dynamic library 'redis.so' (tried: /usr/lib/php/20210902/redis.so (/usr/lib/php/20210902/redis.so: cannot open shared object file: No such file or directory), /usr/lib/php/20210902/redis.so.so (/usr/lib/php/20210902/redis.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 I am encountering the fllowing error: # php -v You can switch to any PHP version as default anytime with the update-alternative utility.I am on Ubuntu 20.04 server and I am trying to upgrade php7.4 to php8.1. It also allows us to install multiple PHP versions on a single system. The Ondrej PPA allows us to install PHP on Ubuntu systems quickly. This tutorial provides you with the instructions to install PHP on Ubuntu 22.04. To uninstall any PHP version just type: sudo apt remove php5.6Īlso, uninstall all the modules for that version with the following command: sudo apt remove php5.6-* Conclusion That will free the disk space as well as system security. If any PHP version is no more required, it can be removed from the system. ![]() Selection number 2 set PHP 7.4 as the default PHP version for the command line. The above output shows all the installed PHP versions on your system. Press to keep the current choice, or type selection number: 2 There are 4 choices for the alternative php (providing /usr/bin/php). Use this tutorial to read more details about switching the PHP version for CLI and Apache. You can use an ` update-alternatives` command to set the default PHP version. To check files for the other PHP versions, just change the PHP version number (8.2 in the above example) in the files and directory path. PHP Active modules configuration directory location:.All the installed PHP modules are stored under /etc/php/8.2/mods-available directory.For example, all the configuration files related to PHP 8.2 are located below: The PHP configuration files are stored under /etc/php directory with the version numbers. With Zend OPcache v8.2.1, Copyright (c), by Zend Technologies Zend Engine v4.2.1, Copyright (c) Zend Technologies Now after installation verify that the correct version of PHP is installed by checking the version number by the below-mentioned command: php -v Users who have installed different PHP versions, need to replace 8.2 with the required PHP versions. Replace with the extension you want to install, if you want to add multiple extensions then include them in braces, I am going to install “php-mbstring, php-mysql, php-xml, and php-curl” by running the below-mentioned command: sudo apt install php8.2-mysql php8.2-mbstring php8.2-xml php8.2-curl That can also be installed using the following syntax: Most PHP applications depend on various extensions to extend their features.Even you can install multiple PHP versions on a single Ubuntu system. Replace version 8.2, 8.1, 7.4, or 5.6 with the required PHP version to install on Ubuntu. Install PHP 5.6 (EOL): sudo apt install php5.6.Install PHP 7.4: sudo apt install php7.4.Install PHP 8.1: sudo apt install php8.1.Install PHP 8.2: sudo apt install php8.2.You can install any of the required PHP versions on your system. As the latest stable version of PHP is 8.2, but a large number of websites still required PHP 7.x. Now, update the Apt package manager cache.LC_ALL=C.UTF-8 sudo add-apt-repository ppa:ondrej/php Add the Ondrej PPA to your system, which contains all versions of PHP packages for Ubuntu systems.Install a few dependencies required by this tutorial with the below-mentioned command: sudo apt install software-properties-common ca-certificates lsb-release apt-transport-https.You just need to add the required PPA and you can install any PHP version on the Ubuntu system.įollow these steps to complete PHP installation on Ubuntu: PHP installation on Ubuntu systems is pretty straightforward. When prompted, press ‘y’ to confirm the installation. Then update the Apt cache and upgrade the current packages of the system using the following command: sudo apt update & sudo apt upgrade Prerequisitesįirst, log in to Ubuntu 22.04 via the console. This tutorial is also compatible with Ubuntu 20.04 LTS, and Ubuntu 18.04 LTS systems. In this tutorial, you will learn how to install PHP on Ubuntu 22.04 LTS system. The new application developers are suggested to use the latest PHP version ie PHP 8.2. You can install any of the versions required for your application. We will use the Ondrej PPA for installing PHP on Ubuntu 22.04 LTS system.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |