How to Install PHP on Ubuntu 20.04 LTS

Jun 10, 2023 07:50 PM - 3 years ago 46969

PHP, which is simply a recursive acronym for PHP Hypertext Preprocessor, is simply a celebrated server-side scripting connection utilized for web development. It is an HTML embedded connection and finds its usage successful a wide scope of websites and web apps.

The astir celebrated usage of PHP has been successful the world of Content Management Systems (CMS). The astir utilized CMS package successful the world, WordPress, uses PHP. Other celebrated CMS package for illustration Drupal and Joomla besides usage PHP and various PHP libraries.

A personification needs to instal PHP connected his Ubuntu 20.04 instrumentality if he/she wishes to instal immoderate specified package which uses PHP, aliases if the personification wants to create his/her ain web application.

In this article, we will spot really to instal PHP connected Ubuntu 20.04 LTS.

Installation

The PHP interpreter, command-line expert and each required libraries are a portion of the php package connected Ubuntu 20.04. Before we get started, let’s first update the repositories.

Let’s instal the package php now.

Note that, if you are looking for a peculiar type for PHP, for example, PHP 7.3 aliases PHP 7.4, they person abstracted packages successful Ubuntu repositories pinch the name php7.3, php7.4, etc. You tin instal them from this package. The resultant PHP expert binary files will besides beryllium named similarly, i.e., php7.3, php7.4.

That being said, the package php will ever incorporate the latest type of PHP disposable successful Ubuntu repositories.

Verifying the Installation

Run the command php with the flag -v (version) to cheque if it is successfully installed.

Similarly, if you person installed a different version, tally the PHP bid for that version, which is ever named successful the format php<version_number>.

That’s it! PHP is now successfully installed successful your system. You tin statesman processing PHP based applications, aliases setup applications which require PHP, eg. WordPress aliases Drupal.

Note that if you are utilizing PHP for improvement purposes, the package php does not instal each the PHP libraries, alternatively it only installs astir commonly utilized libraries. You request to manually instal different required libraries from their respective packages using apt install. These packages travel the nomenclature php-<library_name>, eg. php-curl. To hunt for each specified packages, run apt hunt php.

wordpress

wordpress

wordpress

More