
PHP 5.6 is a legacy version of PHP that reached its end-of-life (EOL) on December 31, 2018. It no longer receives security updates, making it vulnerable to exploits. However, some older applications may still require PHP 5.6 for compatibility.
This article explains how to install PHP 5.6 and PHP-FPM on Debian 12.
Do not use PHP 5.6 in production. It poses significant security risks and should only be used for development or testing.
Before you begin:
Debian 12 does not include PHP 5.6 in its default repositories, you must add a third-party repository. Follow the steps below to add the SURY PHP PPA repository.
Update the server's package information index.
Upgrade all existing packages.
Install the required dependency packages for HTTPS transport and certificate management.
Download the SURY GPG key.
Add the SURY PPA repository information to your APT source file.
Update the package index to apply the repository changes.
Verify the added PPA.
Output:
Follow the steps below to install PHP 5.6 on your server.
Install the PHP 5.6 version.
Verify the PHP version.
Output:
Install the common PHP 5.6 extensions.
PHP-FPM (FastCGI Process Manager) helps PHP work with web servers to manage dynamic content efficiently. Follow the steps below to install PHP-FPM based on the PHP version on your server.
Install PHP 5.6 FPM.
Enable the PHP-FPM service to start at boot automatically.
Start the PHP-FPM service.
Verify the PHP-FPM service status and verify that it's running.
Output:
Before proceeding, verify that PHP 5.6 is functioning. Testing helps confirm that the installation works as expected and that the necessary extensions are loaded.
Create info.php file for testing purposes.
Add the following content to this file.
The phpinfo() function displays information about your PHP environment and other system details.
Save and exit the file.
Enable the PHP-FPM configuration for Apache.
Reload the Apache to apply the new configuration.
Allow the HTTP traffic through the firewall.
Reload UFW to apply the new changes.
Access the info.php file from your web browser and verify that your PHP information displays.
You now have PHP 5.6 and PHP-FPM 5.6 installed on your Debian 12 instance. As tested, your instance can now process and serve PHP files. This version of PHP is obsolete and insecure. Use it only for legacy application testing. For production environments, upgrade to a supported version of PHP 8.3.
0 Comments
Be the first to comment and share your perspective with the community.