11

I'd like to try PHP7.0 on Debian Jessie and am trying to install it from sid. However, php7.0 depends on php7.0-common which depends on php-common > 18 while php-common in sid is at 17. Does this mean it's simply impossible to install php7.0 from this distribution at the moment? Why is that?

I know that it is possible to install from source as explained e.g. here, I'm just asking about the official packages.


Note: the packages in sid have been fixed and it is now (Jan 6, 2016) possible to install from there.

2 Answers 2

22

You have unofficial repos with new versions. Using Debian one of the best well-known repository for most up-to-date software for web servers for i386 and amd64 packages is dotdeb.

"Dotdeb is an extra repository providing up-to-date packages for your Debian servers"

They have PHP 7 since the 3rd of December (of 2015), and have had a pre-packaged beta since November.

To add the dotdeb repository, from here.

Edit /etc/apt/sources.list and add

deb http://packages.dotdeb.org jessie all

Fetch the repository key and install it.

wget https://www.dotdeb.org/dotdeb.gpg
sudo apt-key add dotdeb.gpg

Do then

sudo apt-get update

And lastly:

sudo apt-get install php7.0

To search for php 7 related packages:

apt-cache search php | grep ^php7

In Ubuntu you also already have PPAs for it too.

It seems Debian backports do not have yet PHP 7.0. Search here in a near future.

4
  • @clarkk They have changed it to php7.0. updated the post. Please in future cases, do not open duplicate questions. Jun 1, 2016 at 20:18
  • The debian 7 packages are not always installing properly. I am running cloud services and installed the debian package for php extensions thousands of times automated. There is a chance of like 1:50 that the package is partially failing on install and needs a second "dpkg -i". I could not find the reason so far, I solved it through a loop which installs each extension until it is working.
    – John
    Oct 24, 2016 at 0:56
  • Interesting. I had a similar problem with random stalls/hangups in automated installs and had to introduce timeout parameters. They were not limited to a particular repo. Oct 24, 2016 at 6:49
  • 1
    Yea, I am using a loop in a bash script which tests with "php -r" if the function works and repeats the dpkg install process until it does work. It happens randomly and on the same linux image, so exactly the same start conditions.
    – John
    Oct 24, 2016 at 17:59
3

Add the main repository to your sources.list : Depending on your distribution (Jessie, Wheezy or Squeeze), add these two lines to your /etc/apt/sources.list file.

deb http://packages.dotdeb.org jessie all
deb-src http://packages.dotdeb.org jessie all

For PHP 7.0 on Debian 8 “Jessie” (rc3), add these two lines too :

deb http://packages.dotdeb.org jessie-php7.0 all
deb-src http://packages.dotdeb.org jessie-php7.0 all

Fetch and install the GnuPG key :

wget https://www.dotdeb.org/dotdeb.gpg
sudo apt-key add dotdeb.gpg

Run apt-get update && apt-get install php7-*

1

You must log in to answer this question.