Tutorials  /  Linux Basics

Install PHP 5.6 and PHP-FPM on Debian 12 – Legacy PHP Guide

Ccentron Redaktion · October 2025 ·5 min read ·Linux Basics, Tutorial

PHP 5.6 is an outdated release of PHP that reached end-of-life (EOL) on December 31, 2018. It no longer receives security patches and is therefore vulnerable to exploits. Still, certain legacy applications may depend on PHP 5.6 for compatibility.

Warning

Never use PHP 5.6 in production. It presents serious security vulnerabilities and should only be deployed in development or testing environments.

VM

Matching infrastructure at centron

No hardware needed to follow along: ccloud³ VMs with full root access start at €3.12 per month, billed by the hour and ready in seconds. Rent a cloud server →

Prerequisites

Before you begin:

  • Ensure you have access to a Debian 12 Linux instance with a non-root user who has sudo privileges.

Add the PHP PPA Repository

Debian 12 does not ship with PHP 5.6 in its default repositories. You must add a third-party repository. Follow these steps to include the SURY PHP PPA repository.

Update the package index

Console
$ sudo apt update -y

Upgrade all existing packages

Console
$ sudo apt upgrade -y

Install required dependencies for HTTPS transport and certificate management

Console
$ sudo apt install -y software-properties-common ca-certificates lsb-release apt-transport-https

Download the SURY GPG key

Console
$ sudo wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg

Add the SURY PPA repository information to your APT sources

Console
$ echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/php.list

Update the package index again to apply repository changes

Console
$ sudo apt update -y

Verify the added PPA

Console
$ sudo apt policy php

Example output:

php:
  Installed: (none)
  Candidate: 2:8.4+96+0~20250402.56+debian12~1.gbp84a5b7
...

Install PHP 5.6

Proceed with the following steps to install PHP 5.6 on your Debian 12 system.

Install PHP 5.6

Console
$ sudo apt install php5.6 -y

Verify the PHP version

Console
$ php5.6 -v

Example output:

PHP 5.6.40-81+0~20250311.98+debian12~1.gbp4564f4 (cli) 
...

Install common PHP 5.6 extensions

Console
$ sudo apt install -y php5.6-common php5.6-mysql php5.6-xml php5.6-json php5.6-curl php5.6-gd php5.6-mbstring php5.6-zip

Install PHP 5.6 FPM

PHP-FPM (FastCGI Process Manager) enables PHP to work efficiently with web servers to handle dynamic content. Follow these steps to install PHP-FPM for PHP 5.6.

Install PHP 5.6 FPM

Console
$ sudo apt install -y php5.6-fpm

Enable PHP-FPM service at boot

Console
$ sudo systemctl enable php5.6-fpm

Start the PHP-FPM service

Console
$ sudo systemctl start php5.6-fpm

Check PHP-FPM status

Console
$ sudo systemctl status php5.6-fpm

Example output:

  ● php5.6-fpm.service - The PHP 5.6 FastCGI Process Manager
     Loaded: loaded (/lib/systemd/system/php5.6-fpm.service; enabled; preset: enabled)
     Active: active (running) since Sat 2025-04-12 03:58:28 UTC; 11s ago
...

Test and Use PHP 5.6

Before proceeding, confirm that PHP 5.6 is working correctly and that the required extensions are active.

Create an info.php file for testing

Console
$ sudo nano /var/www/html/info.php

Add the following content to the file

Code
<!--?php phpinfo(); ?-->

The phpinfo() function displays details about your PHP setup and other system information.

Save and close the file.

Enable the PHP-FPM configuration for Apache

Console
$ sudo a2enconf php5.6-fpm

Reload Apache to apply the new configuration

Console
$ sudo systemctl reload apache2

Allow HTTP traffic through the firewall

Console
$ sudo ufw allow http

Reload UFW to apply the changes

Console
$ sudo ufw reload

Now open the info.php file in your web browser and confirm that PHP information is displayed.

Example: http://app.example.com/info.php

Conclusion

You have successfully installed PHP 5.6 and PHP-FPM 5.6 on Debian 12. Your system can now process and serve PHP files. Remember that this PHP version is outdated and insecure. Use it only for legacy application testing, and for production environments upgrade to a supported PHP release such as PHP 8.3.

Jetzt 200 € Guthaben sichern

Testen Sie Ihr Setup auf ccloud³

Registrieren Sie sich in der ccloud³ und erhalten Sie 200 € Startguthaben für Ihr Projekt – z. B. für eine PostgreSQL-VM mit automatischen Backups.

centron Redaktion Technische Redaktion

Das Redaktionsteam von centron schreibt Anleitungen aus dem Betriebsalltag: getestet auf unserer eigenen Plattform, betrieben im Rechenzentrum in Hallstadt bei Bamberg.

Kategorie Linux Basics
Teilen
Noch offene Fragen?

Our team will help you with your specific setup - in German or English, by people who run the platform themselves.

War dieses Tutorial hilfreich?

Your answer is stored anonymously and helps us improve our tutorials.

Kommentare

No comments yet - be the first to ask a question about this tutorial.

Sign in to comment

Comments are open to centron customers. Sign in to your account to ask a question about this tutorial.

Weiterlesen

Das könnte Sie auch interessieren

Jetzt kostenlos anfangen

Melden Sie sich an und erhalten Sie in den ersten 60 Tagen ein Guthaben von 200 € bei centron.

Dieses Werbeangebot gilt nur für neue Konten. Angebot ausschließlich für Gewerbetreibende.

Jetzt loslegen Sales kontaktieren