How To Install php 7.2 On Debian 9 Server
Now I want to share how to install php 7.2 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 [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
Step #02: Install php 7.2 version on debian 9.
[email protected]~:# apt update [email protected]~:# apt install php7.2 -y [email protected]~:# apt install php7.2 php7.2-cli php7.2-common php7.2-json php7.2-opcache php7.2-mysql php7.2-zip php7.2-fpm php7.2-mbstring apache2 -y
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.
<?php phpinfo(); ?>
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://192.168.1.20/phpinfo.php
Enjoy it 🙂