How To Install php 7.4 On Debian 9 Server
Now I want to share how to install php 7.4 on your debian 9 server. Php is an opensource server side programming language for linux, windows and more. So now I want to share how to install it.
- How To Change MySQL Root Password Using Terminal Ubuntu Server
- How To Setup Permanent DNS Nameservers on Ubuntu 19.04
Step #01: Must be server update and upgrade complete.
[email protected]~:# apt update && apt upgrade -y
Update php repo list using below command.
[email protected]~:# apt install apt-transport-https lsb-release ca-certificates -y [email protected]~:# wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg [email protected]~:# echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list [email protected]~:# apt update
Step #02: Install php 7.2 version on debian 9.
[email protected]~:# apt install php7.4 -y [email protected]~:# apt install php7.4 php7.4-cli php7.4-common php7.4-json php7.4-opcache php7.4-mysql php7.4-zip php7.4-fpm php7.4-mbstring apache2 -y [email protected]~:# systemctl restart apache2
Now test php work is properly. So create php info file.
[email protected]~:# nano /var/www/html/phpinfo.php
Insert below code into phpinfo.php file.
Then save it and restart web server apache using below command.
[email protected]~:# systemctl restart apache2
Now browse your server ip address and see is working properly.
http://10.66.11.7/phpinfo.php