{"id":13093,"date":"2023-05-05T07:23:03","date_gmt":"2023-05-05T11:23:03","guid":{"rendered":"http:\/\/local.brightwhiz\/?p=13093"},"modified":"2023-05-05T07:23:07","modified_gmt":"2023-05-05T11:23:07","slug":"how-to-install-php-8-2-on-debian-11-debian-10","status":"publish","type":"post","link":"http:\/\/local.brightwhiz\/how-to-install-php-8-2-on-debian-11-debian-10\/","title":{"rendered":"How To Install PHP 8.2 on Debian 11 | Debian 10"},"content":{"rendered":"\n
This tutorial will show you how to install PHP 8.2 on Debian 11 (Bullseye) and Debian 10 (Buster) Linux systems. If you are interested in installing PHP 8.2 on Ubuntu systems<\/a>, we have a post for that as well as this post showing how to install on CentOS 7 and RHEL 7 based Linux systems<\/a>.<\/p>\n\n\n\n PHP 8.2 is the most recent version of PHP<\/a> released on December 8, 2022. This version comes with a host of new features, improvements, and bug fixes including but not limited to:<\/p>\n\n\n\n These are the steps to follow in order to install PHP 8.2 on Debian<\/a> 11 (Bullseye) and Debian 10 (Buster) Linux systems.<\/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 import repository GPG key and add the repository to your sources list.<\/p>\n\n\n\n Update the package list.<\/p>\n\n\n\n Run the commands below to perform the installation:<\/p>\n\n\n\n Run the following command to confirm the version of PHP currently installed on your Debian system.<\/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<\/strong><\/p>\n\n\n\n The we would run the following command to install the above extensions:<\/p>\n\n\n\n We have a more comprehensive article showing how to install PHP modules in Ubuntu<\/a> if you need more details. The steps highlighted in the article also apply to Debian based systems.<\/p>\n\n\n\n You now know how to install Install PHP 8.2 on Debian 11 | Debian 10 Linux systems. We have also shown you how to install PHP8.2 extensions<\/a> to get the functionality you need. If you need to run your PHP with Nginx<\/a> or Apache web servers, we have this tutorial showing you how to use PHP 8.2 with Nginx \/ Apache<\/a> web servers.<\/p>\n","protected":false},"excerpt":{"rendered":" This tutorial will show you how to install PHP 8.2 on Debian 11 (Bullseye) and Debian 10 (Buster) Linux systems. If you are interested in installing PHP 8.2 on Ubuntu…<\/p>\n","protected":false},"author":1,"featured_media":13100,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,23,9,25,16],"tags":[183,350,354,424,433,449,452,471,544,591,638],"yoast_head":"\n\n
#[SensitiveParameter]<\/code> that ensures PHP redacts the actual value in stack traces and error messages.<\/li>\n\n\n\n
ini_parse_quantity<\/code>,
curl_upkeep<\/code>,
openssl_cipher_key_length<\/code>, and
memory_reset_peak_usage<\/code> are now included.<\/li>\n\n\n\n
utf8_encode<\/code> and
utf8_decode<\/code> Functions are now deprecated<\/li>\n<\/ul>\n\n\n\n
Install PHP 8.2 on Debian 11 \/ Debian 10<\/h2>\n\n\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 wget -O \/etc\/apt\/trusted.gpg.d\/php.gpg https:\/\/packages.sury.org\/php\/apt.gpg \n$ sudo sh -c 'echo "deb https:\/\/packages.sury.org\/php\/ $(lsb_release -sc) main" > \/etc\/apt\/sources.list.d\/php.list'<\/code><\/pre>\n\n\n\n
$ sudo apt update<\/code><\/pre>\n\n\n\n
Step 2. Install PHP 8.2 Packages<\/h2>\n\n\n\n
$ sudo apt install php8.2<\/code><\/pre>\n\n\n\n
$ php -v\nPHP 8.2.4 (cli) (built: Mar 16 2023 14:37:38) (NTS)\nCopyright (c) The PHP Group\nZend Engine v4.2.4, Copyright (c) Zend Technologies\n with Zend OPcache v8.2.4, 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