skip to Main Content

I recently restored my personal test server with a completely fresh install of Debian 8.

The Service Provider where I purchased the Virtual Server, has only the Debian 8 option. So there is currently no possibility to upgrade to stretch or buster (9 and 10).

I need to install at least PHP 7.2 on my server to meet the requirements for the project and I’m having a hard time accomplishing that. As www.dotdeb.org seems to be discontinued I am wondering what package source I should add for PHP 7.2. All I found googling around was when dotdeb was still providing 7.2 packages.

My sources.list looks like this:

deb http://debian.mirror.serverloft.de/debian/ jessie main contrib non-free
deb http://debian.mirror.serverloft.de/debian-security/ jessie/updates main contrib non-free
deb http://packages.dotdeb.org jessie all
deb https://packages.sury.org/php/ jessie main
deb-src http://packages.dotdeb.org jessie all

but when I do

apt-get uptate
apt-get install php 7.2

I get

E: Unable to locate package php7.2
E: Couldn't find any package by regex 'php7.2'

Maybe there is no such option anymore and I have to change the provider to get a higher Debian version?

2

Answers


  1. I’ve got PHP 8.0 from this all-in-one bundle: https://bitnami.com/stack/lapp/installer

    It does not depend on Linux distro

    Login or Signup to reply.
  2. You can install the php 7.2 or later in debian jessie. But you need to follow some steps for getting this. The main reason is debian platform has been stopped the sury package service for jessie. Please check this link https://packages.sury.org/php/dists/
    Now you know, it’s not have the jessie support.

    Okay Now we start the process of php 7.2 installation

    1. Open /etc/apt/sources.list and add deb http://ftp.de.debian.org/debian stretch main.
      It helps to get the stretch repos for the supporting dependencies of php 7.2

    2. $ sudo apt update

    3. $ sudo nano /etc/apt/sources.list.d/php.list.

      then add deb https://packages.sury.org/php/ stretch main. this is also a stretch repo

    4. $ sudo apt update

    5. Now the php needs the updation of libncurses5 >= 6
      check the current available version of libncurses5

      $ sudo apt search libncurses5 //it shows you the libncurses5 as 6.0

      $ sudo apt install libncurses5

    6. $ sudo apt-get install php7.2 php7.2-readline php7.2-cli php7.2-fpm

    7. $ sudo apt install php7.2-common php7.2-mysql php7.2-xml php7.2-xmlrpc php7.2-curl php7.2-gd php7.2-imagick php7.2-dev php7.2-imap php7.2-mbstring php7.2-opcache php7.2-soap php7.2-zip php7.2-intl -y

    8. check unix socket is found in /var/run/php

    Now you found php7.2-fpm.sock in this directory

    1. Last step. just start the php service: $ sudo service php7.2-fpm start
      Now you check the status and version of php $ sudo service php7.2-fpm status && $ php -v

    Hurray. you got the newest version of php. Thanks a lot

    Note: Don’t forget to stop the previous service for php in your machine

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search