![]() ![]() Check Any Syntax Error with Apache sudo apache2ctl -tĪpache Syntax Error Check Output Restart the Apache Webserver Now use the following command to enable the latest version of PHP using the following command: sudo a2enmod php8.1 Note:- If you are installing PHP in your newly deplyoed system, then you don't need to switch between the PHP versions. sudo a2dismod php8.0 Enable the Latest PHP In case, your system has installed PHP 7.4 or lower version and you want to upgrade to the latest version, then replace php8.0 to your current version of PHP. Mostly in this case Apache web server will be installed, so we have to disable the older version of PHP and then need to enable the latest PHP 8.1.įor that you have to follow these commands: Disable the Old PHP Possibly you are upgrading PHP on your server, and that means your server has a web server. Installing the latest version of PHP modules or extensions uses the following commands: sudo apt install php8.1- How to Switch from Older PHP to Latest PHP 8.1 on Apache In WordPress, you will need various PHP modules like php-mysql, php-imagick, needs for connecting with the MySQL database and handling the images on site respectively. Modules are very important for doing work with PHP, and different kinds of work will be handled by different-different PHP modules. Install Latest PHP 8.1 Modules/Extensions Use the following command to check: sudo php -v ![]() Check the Installed Version of PHPĪfter the completion of the installation of the latest PHP 8.1, you can check whether it was successfully installed or not. sudo apt install php8.1 sudo apt install php8.1-common php8.1-cliĪfter using the following command you will see a prompt like this, and you have to type “Y” and then hit enter on the keyboard to install the PHP. Install PHP 8.1Īfter updating the latest PHP dependencies and repositories, use the following command to install PHP 8.1 on the server. echo "deb buster main" | sudo tee /etc/apt//php.list sudo apt update Must Read: Upgrade PHP 8.2 from PHP 8.1.x or Older Version Step – 3. cd /etc/apt/ sudo wget Īfter adding apt.gpg keyring file, you check it using ls -l command, and after that, we need to add the PHP source list in Debian Linux. Now we need to add a keyring file in directory which is required to add the latest PHP repository in Debian systems. Nowadays most dedicated VPS server provides Ubuntu or Debian-based server so, check your system and use the following command accordingly.įor Ubuntu 22.04, 21.04, 20.04, 18.04: sudo apt update sudo apt install lsb-release ca-certificates apt-transport-https software-properties-common -y sudo add-apt-repository ppa:ondrej/phpįor Debian 11, 10, 9: sudo apt install -y gnupg2 ca-certificates apt-transport-https software-properties-common ![]() You must know which Linux distro you are using as a server. Add Latest PHP 8.1 Package DependencyĪfter updating system dependencies using the command mentioned above, and now you must run the following commands to update your server with the latest PHP dependency. Use the following command to update your system dependencies and repositories, so you can install the latest stable version of PHP. Must Read: How to Upgrade PHP 8.0 from PHP 7.4 Step – 1. You can use the same commands for all Linux distros, which are based on Debian or Ubuntu in a few steps. This method will be for Dedicated servers and Desktops that are based on Linux operating system (Ubuntu or Debian-based distros). Manual Installation/Upgradation PHP 8.1 on Linux Server Install Latest PHP Modules or Extensions. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |