To change the default version, simply enter the number that matched the appropriate version you want to make as the default and press ENTER.įor example, to make PHP 7.2 as the default version, simply type 2 and press ENTER. Press to keep the current choice, or type selection number:Īs you can see, we have PHP 7.4 as the default version of PHP. Sample command output There are 4 choices for the alternative php (providing /usr/bin/php). To list the available versions update-alternatives -config php If you have multiple versions of PHP installed on Debian 11, you can choose to make one of the versions as the default PHP version. To install PHP 7.3 modules, run the command apt install php7.3-EXTENSION Set default PHP version on Debian 11 Once the repository is in place, install PHP 7.3 on Debian 11 by executing the command apt install php7.3 To install PHP 7.2 modules, run the command apt install php7.2-EXTENSION Install PHP 7.3 on Debian 11 To install PHP 7.2 on Debian 11 by executing the command apt install php7.2 To install PHP 7.1 modules, run the command apt install php7.1-EXTENSION Install PHP 7.2 on Debian 11 Once the repository is in place, install PHP 7.1 on Debian 11 by executing the command apt install php7.1 Next, update the system package cache apt update Install PHP 7.1 on Debian 11 To add SURY repository on Debian 11, run the commands below apt -y install apt-transport-https lsb-release ca-certificates curl wget wget -O /etc/apt//php.gpg sh -c 'echo "deb $(lsb_release -sc) main" > /etc/apt//php.list' In order to install PHP 7.1/7.2/7.3 on Debian 11, you need to add SURY, the third party repositories that provides PHP packages for Debian systems. If the module is available, then install it using the command apt install php7.4-EXTENSIONįor example apt install php7.4-mysql Install PHP 7.1/7.2/7.3 on Debian 11 Install SURY Repository For example apt-cache search php7.4-mysql Where EXTENSION is the PHP module you want to install. To install additional modules, first check if the modules is provided by the default repositories apt-cache search php7.4-EXTENSION With Zend OPcache v7.4.21, Copyright (c), by Zend Technologies Install PHP 7.4 Modules on Debian 11īy default, quite a number of PHP 7.4 modules are already enabled. Zend Engine v3.4.0, Copyright (c) Zend Technologies ![]() Once the installation command completes, run the command below to verify the installed version of PHP on Debian 11 php -v PHP 7.4.21 (cli) (built: 03:59:48) ( NTS ) The following NEW packages will be installed:Īpache2 apache2-bin apache2-data apache2-utils libapache2-mod-php7.4 libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap libcurl4 liblua5.3-0 libsodium23 phpĠ upgraded, 22 newly installed, 0 to remove and 0 not upgraded.Īfter this operation, 28.3 MB of additional disk space will be used. Php-common php7.4 php7.4-cli php7.4-common php7.4-json php7.4-opcache php7.4-readline psmisc ssl-certĪpache2-doc apache2-suexec-pristine | apache2-suexec-custom www-browser php-pear The following additional packages will be installed:Īpache2 apache2-bin apache2-data apache2-utils libapache2-mod-php7.4 libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap libcurl4 liblua5.3-0 libsodium23 This make it easy install PHP 7.4 on Debian 11. ![]() ![]() The default Debian 11 repositories provide PHP 7.4 apt-cache policy php php:ĥ00 bullseye/main amd64 Packages Install PHP 7.4 on Debian 11Īs seen from the command output above, the default Debian 11 main repositories provide PHP 7.4. PHP is a fast, flexible, pragmatic, popular general-purpose scripting language that is especially suited to web development. If you want to learn how to install PHP 7.1/7.2/7.3/7.4 on Debian 11, then follow through this guide.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |