PHP is perhaps one of the most popular programming languages in the world. Most websites and internet applications are built using this programming language. Here we have told you a lot about this language, especially when we have to do some web technology. Recently, a new major version of the language was released and comes with many new features and novelties. So, that is why today I will show you how to install PHP 7.3 on Ubuntu 18.04 and Linux Mint 19.
PHP 7.3 comes with a number of new features that make you think about upgrading. Some of them refer to a more flexible heredoc and nowdoc syntax. And several performance improvements in the compiler. Keep in mind that if you are very happy with your current version of PHP, you may not want to update, but on the contrary, if you have a malfunction or want to plug a security hole, I recommend you update.
So, let us install PHP 7.3.
1. Upgrade the system
The first step, update the entire system. I always recommend you to do it for security reasons.
:~$ sudo apt update && sudo apt upgrade
After that, the system is ready to start installing PHP 7.3.
2. Check your current PHP version and the external repository
For the change to be noticeable, first check the version of PHP you have installed. You can do this with the following command:
:~$ php -v
As you can see, I do not have it installed. If as I do not have it installed, you can look for it in the official repositories and see which version you have available for now.
:~$ sudo apt search php
So, you have to add an external PPA to install PHP 7.3. However, first, you have to install these required packages.
:~$ sudo apt install software-properties-common
Then, add the PPA.
:~$ sudo add-apt-repository ppa:ondrej/php
And next, refresh the APT cache.
:~$ sudo apt update
Now, you can install it without any problems.
3. Install PHP 7.3 on Ubuntu 18.04 and Linux Mint
Now yes, first use APT to search for PHP packages and verify that the available version is 7.3.
:~$ sudo apt search php
Now, install PHP 7.3 and some of the most commonly used extensions:
:~$ sudo apt install php7.3 php7.3-cli php7.3-common php7.3-opcache php7.3-curl php7.3-mbstring php7.3-mysql php7.3-zip php7.3-xml
Next, check the version installed:
:~$ php -v
So, that is it.
Conclusion
It is important to update a critical element of a web server such as PHP. This is because development is very active and more and more applications require newer versions of the compiler.
Please share with your friends.
muchas gracias !! 😉
when I tried to execute this commando I have this results
sudo add-apt-repository ppa:ondrej/php
Adding PPAs is not supported
someone know how to fix it
Hi, are you sure that you are running Ubuntu or Linux Mint (Not Linux Mint Debian Edition)?
Thank you for the article. Very helpful indeed.
Thanks for your comment! Do not forget to share.