{"id":13097,"date":"2023-05-05T07:24:48","date_gmt":"2023-05-05T11:24:48","guid":{"rendered":"http:\/\/local.brightwhiz\/?p=13097"},"modified":"2023-05-05T07:25:17","modified_gmt":"2023-05-05T11:25:17","slug":"how-to-install-php-8-2-on-ubuntu-22-0420-0418-04","status":"publish","type":"post","link":"http:\/\/local.brightwhiz\/how-to-install-php-8-2-on-ubuntu-22-0420-0418-04\/","title":{"rendered":"How To Install PHP 8.2 on Ubuntu 22.04|20.04|18.04"},"content":{"rendered":"\n
Today we will be showing you how to install PHP 8.2 on Ubuntu 22.04, 20.04, or 18.04 Linux systems. For those looking for other distros, we have a tutorial on installing PHP 8.2 on Debian systems<\/a> and another one for CentOS 7 and RHEL 7<\/a> distros.<\/p>\n\n\n\n PHP 8.2 is the current version of the PHP<\/a> programming language released in December 2022 with many new features as highlighted below:<\/p>\n\n\n\n Add the PPA that contains the latest PHP packages. Install dependency packages for this.<\/p>\n\n\n\n Install the tool to get the release.<\/p>\n\n\n\n Now we add ondrej\/php to the repositories.<\/p>\n\n\n\n Run the following command to install PHP 8.2.<\/p>\n\n\n\n Confirm and check the version of PHP currently installed on the system run the following command:<\/p>\n\n\n\n You can now install the PHP 8.2 extensions that you require. PHP extensions are libraries that provide extra functionality to the PHP programming language.<\/p>\n\n\n\n To install a PHP extensions you would need to run a command with the following syntax:<\/p>\n\n\n\n For example, assuming we want to install the following PHP extensions:<\/p>\n\n\n\n bz2, cli, common, curl, intl, mbstring, mysql, zip<\/p>\n\n\n\n The we would run the following command to install the above extensions:<\/p>\n\n\n\n We have prepared a more comprehensive article showing how to install PHP modules in Ubuntu<\/a> if you need more details.<\/p>\n\n\n\n You now know how to install Install PHP 8.2 on Ubuntu 22.04|20.04|18.04 Linux systems. We have also shown you how to install PHP8.2 extensions to get the functionality you need. If you need to run your PHP with Nginx or Apache web servers, we have a tutorial showing you how to use PHP 8.2 with Nginx \/ Apache web servers<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":" Today we will be showing you how to install PHP 8.2 on Ubuntu 22.04, 20.04, or 18.04 Linux systems. For those looking for other distros, we have a tutorial on…<\/p>\n","protected":false},"author":1,"featured_media":13098,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,23,9,25,16],"tags":[],"yoast_head":"\n\n
Step 1. Add Sury PPA repository<\/h2>\n\n\n\n
$ sudo apt update\n$ sudo apt install lsb-release apt-transport-https ca-certificates software-properties-common -y<\/code><\/pre>\n\n\n\n
$ sudo apt install lsb_release<\/code><\/pre>\n\n\n\n
$ sudo add-apt-repository ppa:ondrej\/php\n$ sudo apt update<\/code><\/pre>\n\n\n\n
Step 2. Install PHP 8.2 on Ubuntu 22.04|20.04|18.04<\/h2>\n\n\n\n
$ sudo apt install php8.2<\/code><\/pre>\n\n\n\n
$ php -v\n\nOutput\n\nPHP 8.2.1 (cli) (built: Jan 13 2023 10:43:08) (NTS)\nCopyright (c) The PHP Group\nZend Engine v4.2.1, Copyright (c) Zend Technologies\n with Zend OPcache v8.2.1, Copyright (c), by Zend Technologies<\/code><\/pre>\n\n\n\n
Step 3. Install PHP 8.2 extensions<\/h2>\n\n\n\n
sudo apt install php8.2-<extension-name><\/code><\/pre>\n\n\n\n
$ sudo apt install php8.2-{bz2,cli,common,curl,intl,mbstring,mysql,zip}<\/code><\/pre>\n\n\n\n
Conclusion<\/h2>\n\n\n\n