This version is no longer officially supported.
Official support refers to that provided direct by the PHP Project.
If you install PHP via third-party packages, support timelines may be different.
Please read the Release Support Policy for more information.
Installing via sury.org
Official Debian / Ubuntu repositories only offer one version of PHP per major release of their distribution, but they do
maintain it for the entire lifetime of that distribution.
To have access to the full range of PHP versions, the recommendation is to use the sury.org repository.
Note that these are not officially provided by the PHP project
# Add the packages.sury.org/php repository to gain access to additional versions
sudo apt update
sudo apt install -y lsb-release ca-certificates curl
sudo curl -sSLo /tmp/debsuryorg-archive-keyring.deb https://packages.sury.org/debsuryorg-archive-keyring.deb
sudo dpkg -i /tmp/debsuryorg-archive-keyring.deb
sudo tee /etc/apt/sources.list.d/php.sources <<EOF
Types: deb
URIs: https://packages.sury.org/php/
Suites: $(lsb_release -sc)
Components: main
Signed-By: /usr/share/keyrings/debsuryorg-archive-keyring.gpg
EOF
sudo apt update
# Install PHP 5.0
sudo apt install -y php5.0-cli