Install PHP 7.2 on Debian 9 Rumi, December 8, 2019 Before you start with the installation of PHP 7.2 on your Debian VPS, make sure that you have full root access to it. Connect to the server via SSH and upgrade all the system software to the latest version available. You can do this by running the following commands in the terminal: sudo apt-get update sudo apt-get upgrade This will update the package index and will update the software currently installed on the server to the latest version. Once your system is fully up to date, you can proceed to the next step, which is installing PHP 7.2. Import the signing key and enable the PPA for PHP 7.2 by using the following commands: wget -q https://packages.sury.org/php/apt.gpg -O- | sudo apt-key add - echo "deb https://packages.sury.org/php/ stretch main" | sudo tee /etc/apt/sources.list.d/php.list Once you are done with this, run the package index update once again using the command below: sudo apt-get update In case you get an error like the one below: Reading package lists... Done E: The method driver /usr/lib/apt/methods/https could not be found. N: Is the package apt-transport-https installed? E: Failed to fetch https://packages.sury.org/php/dists/stretch/InRelease E: Some index files failed to download. They have been ignored, or old ones used instead. It means there are some missing packages that you need to install first. Install the required packages by running the following command: sudo apt-get install ca-certificates apt-transport-https The run the update command again. Finally, install PHP 7.2 on your Debian 9 VPS including some of the commonly used extensions using the command below: sudo apt-get install php7.2 php7.2-cli php7.2-common php7.2-opcache php7.2-curl php7.2-mbstring php7.2-mysql php7.2-zip php7.2-xml To verify the installation is completed run the following command: php -v The output should be very similar to the one below: # php -v PHP 7.2.9-1+0~20180901081133.4+stretch~1.gbpdaac35 (cli) (built: Sep 1 2018 08:11:34) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies with Zend OPcache v7.2.9-1+0~20180901081133.4+stretch~1.gbpdaac35, Copyright (c) 1999-2018, by Zend Technologies Change/Customize PHP 7.2 settings on a Debian VPS Next thing you may want to complete is to customize the PHP 7.2 settings to meet your requirements. You can do so by editing the php.ini file. To find the path to this file, you can use the command below: php --ini | grep "Loaded Configuration File" It will return the path to the php.ini file which is currently loaded. # php --ini | grep "Loaded Configuration File" Loaded Configuration File: /etc/php/7.2/cli/php.ini Edit the file using a text editor of your choice. We will use nano in this example. nano /etc/php/7.2/cli/php.ini Once you change the settings, save and close the file. If you are using Apache as a web server, you need to restart it for the new configuration to be loaded and for the changes to take effect. If you are using Nginx and PHP-FPM, you should restart the PHP-FPM service. You can also create a sample info.php and see if the PHP files and executed on the server. To create the file: nano /var/www/html/info.php and paste the following: <?php phpinfo(); ?> Save and close the file, then open you favorite web browser and access the file by using your server IP address in the URL followed by the name of the file. http://IP-ADDRESS/info.php Related Administrations Configurations (Linux) Debian 9PHP 7.2
How to Enable /etc/rc.local with Systemd February 24, 2020 If you are running a Linux distro that uses Systemd, then you may find that your command in /etc/rc.local file would not run on system boot. This guide explains how to enable /etc/rc.local script to run on system startup. Enable /etc/rc.local on Systemd If you type the following command in… Read More
Installing Let’s Encrypt on a Zimbra Server June 15, 2018June 15, 2018 Let’s Encrypt must be installed on one Linux machine to obtain the proper SSL Certificate, CA Intermediate, and Private Key. It is not required that it be on the same Zimbra Server, but it could save time and help to obtain the renewals, etc. First Step is to stop the… Read More
How to upgrade PHP 5.2 Centos April 27, 2011September 5, 2017 Method-1 This guide describes how to upgrade the standard PHP 5.1.x packages in CentOS 5.x 32-bit to the current development versions 5.2.x. These instructions were created using CentOS 5.3 32-bit and with the following PHP packages installed: # rpm -qa |grep php php-common-5.1.6-15.el5.i386 php-cli-5.1.6-15.el5.i386 php-5.1.6-15.el5.i386 php-pdo-5.1.6-15.el5.i386 php-bcmath-5.1.6-15.el5.i386 php-ldap-5.1.6-15.el5.i386 php-devel-5.1.6-15.el5.i386 php-gd-5.1.6-15.el5.i386… Read More