How to Easily Change PHP Version on Ubuntu (Step-by-Step Guide)

How to Easily Change PHP Version on Ubuntu (Step-by-Step Guide)

Tech Help

54 года назад

9 Просмотров

In this video, we'll walk you through the process of changing the PHP version on your Ubuntu system. Whether you're working on a web project that requires a specific version of PHP or just want to test new features, this tutorial will guide you step-by-step.
How to change php version on ubuntu setp by step.
List of command :-
1) php -v
- This command check your current php Version.

2) sudo update-alternatives --config php
- This command gives list of php version install on your system and you choose appropriate option in our case we select 3 because i want to change my php version 8.0 to 8.3 so.

3) sudo update-alternatives --config phar
-When you execute sudo update-alternatives --config phar, you’ll see a list of all the installed versions of the Phar command. You’ll be prompted to select the desired version by entering its corresponding number. This updates the symbolic link for the phar command, setting the default version that will be used in the terminal and by PHP scripts that utilize Phar.

4) sudo update-alternatives --config phar
-When you run sudo update-alternatives --config phar.phar, you will see a list of all installed versions of the phar.phar command. You can then select the desired version by entering the corresponding number. This action updates the symbolic link for the phar.phar command, determining which version will be executed when you run it in the terminal.

5) sudo a2dismod php8.0
- this command disable you php version 8.0

6) sudo a2enmod php8.3
-This command enable your php version 8.3

7) sudo systemctl restart apache2
- This command restart apache server with new configuration.

By the end of this video, you'll be able to easily manage different PHP versions on your Ubuntu machine. Don’t forget to like, subscribe, and hit the bell icon for more tutorials!
Ссылки и html тэги не поддерживаются


Комментарии: