Title pretty much says all. I know about adding the stretch to get PHP 7. But it doesn't show PHP 7.1.

deb http://mirrordirector.raspbian.org/raspbian/ stretch main contrib non-free rpi

Bonus question where should I drop the request to update the default PHP version of Raspbian?

2 Answers 2


The package php7.1 isn't in the stretch repo, but it is in the buster and sid repositories (for Debian 10 and unstable, respectively).

You should be able to just change stretch to buster, and then run:

$ [sudo] apt-get install php7.1

You may find it helpful to upgrade your system as recommended in the Debian documentation when doing this using apt-get update && apt-get upgradebe aware that this will upgrade your entire system from stable to testing, and many packages are likely to be upgraded.

On to your bonus question:

Where should I drop the request to update the default PHP version of Raspbian?

The default version of PHP in Raspbian is extremely unlikely to be changed for now, because of the way that Debian's release cycles work:

In the above array, data closely following "current" releasing tendencies have been highlighted in green. What can be deduced from those data is that the "most-typical" Debian release:

  • endures a freeze cycle of 7 +/- 1 months before getting released.
  • is released about 2 years after the previous one (the often cited example of Debian Sarge being quite an exceptional event in Debian history).
  • leaves users about 1 year to upgrade to the next one once this latter itself gets released.
  • has (from release to the end of security updates) a total lifetime of about 3 years.

Stretch was frozen in February 2017, so there will be no new feature updates to the PHP package in the Stretch repositories. So, for the foreseeable future, the PHP package will remain outdated in stable until Raspbian Buster becomes stable (at which point, the PHP package there will become outdated, ad infinitum).

It's just the nature of Debian: you trade away the newest packages in exchange for greater stability, and you'll have to stick to the testing release if you want the latest features.

  • 1
    I've used the lower prio and only install with the sudo apt-get install -y -t stretch php7.0.... to prevent from having stretch on other components.
    – janw
    Commented Jul 27, 2017 at 15:03

Worked for me with instructinos of Heidi's Lab:

  1. In /etc/apt/sources.list change stretch to buster, which is the next-stable/testing repository.
  2. Update System sudo apt-get update && sudo apt-get upgrade
  3. Remove previous PHP sudo apt-get remove '^php.*'
  4. Install PHP 7.1 sudo apt-get install php7.1-fpm php7.1-cli or sudo apt-get install php7.1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.