Installing PHP 7.4 on Debian 12
Installing PHP 7.4 (By default, Debian 12 install php 8.2 but we are using here php 7.4)
apt-get -y install lsb-release ca-certificates curl curl -sSLo /etc/apt/keyrings/deb.sury.org-php.gpg https://packages.sury.org/php/apt.gpg sh -c 'echo "deb [signed-by=/etc/apt/keyrings/deb.sury.org-php.gpg] https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list' apt-get update
Edit nano /etc/apt/preferences.d/stable
This is to tell debian to use default Debian repo to install packages.
Package: * Pin: release o=Debian Pin-Priority: 900
Edit nano /etc/apt/preferences.d/php
This is to tell debian to use sury as repo for php 7.4 and lower and for 8.2, use default repo.
Package: php8.2* Pin: release o=Debian Pin-Priority: 900 Package: php-* Pin: origin "packages.sury.org" Pin-Priority: 900 Package: php7.4* Pin: origin "packages.sury.org" Pin-Priority: 900
Install php
apt-get update apt install php7.4 apt install php7.4-zip php7.4-curl php7.4-json php7.4-xml php7.4-posix php7.4-mysqlndl php7.4-gd php7.4-process php7.4-curl php7.4-mbstring php7.4-pdo php7.4-pgsql
0
Howdy, Stranger!
Categories
- 83 All Categories
- 15 VoIP
- 7 SIP
- 11 asterisk
- 41 Programming
- 1 Nodejs
- 4 javascript
- 18 PHP
- 8 Codeigniter
- 12 database
- 1 UI/UX
- 2 Flutter
- 25 OS
- 23 Linux
- 1 Virtualization
- 1 Android
- 1 Windows
- 2 legal