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: php* Pin: origin "packages.sury.org" Pin-Priority: 900 Package: libapache2-mod-php* 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-mysqlnd php7.4-gd php7.4-curl php7.4-mbstring php7.4-pdo php7.4-pgsql apt install libapache2-mod-php7.4 systemctl restart apache2 a2enmod php7.4
0
Howdy, Stranger!
Categories
- 94 All Categories
- 20 VoIP
- 7 SIP
- 16 asterisk
- 44 Programming
- 1 Nodejs
- 4 javascript
- 19 PHP
- 8 Codeigniter
- 14 database
- 1 UI/UX
- 2 Flutter
- 28 OS
- 26 Linux
- 1 Virtualization
- 1 Android
- 1 Windows
- 2 legal