I'm using rasapbian jessie I'm attempting to install pecl_http, raphf, propro and other php modules but I'm getting the following error when I run sudo pecl install pecl_http etc:

pecl/pecl_http requires PHP (version >= 7.0.0), installed version is 5.6.30-0+deb8u1 pecl/raphf requires PHP (version >= 7.0.0), installed version is 5.6.30-0+deb8u1 pecl/propro requires PHP (version >= 7.0.0), installed version is 5.6.30-0+deb8u1 No valid packages found install failed

However, I can't install php7 from raspbian repositories.

  • Can I ask you how you installed pecl? I have the opposite problem. I installed php7.0-dev and when I run pecl install [anything] I get Parse error: syntax error, unexpected 'new' (T_NEW) in /usr/share/php/PEAR/Frontend.php on line 91 because the code is not PHP7 compatible! – TheStoryCoder Sep 17 '17 at 9:26
  • Ha! Now I uninstalled php7 and went back to php5, and then I get the same error message as you... Good gracious! – TheStoryCoder Sep 17 '17 at 10:47

Since php7.0 is not available in the official repository, you can use some other trusted private repositories. This is what you should do in order to install phpp7.0 form mati75's private repository(Also read this Are PPA's safe to add to my system and what are some “red flags” to watch out for? ) :

1.First, remove the php version that you already have installed :

sudo apt-get purge php*

This will remove the current installation of php and php extensions from your Pi.

2.Now add the repository sources to your sources.list :

sudo nano /etc/apt/sources.list

Then add these line to the end of that file :

deb http://repozytorium.mati75.eu/raspbian jessie-backports main contrib non-free
#deb-src http://repozytorium.mati75.eu/raspbian jessie-backports main contrib non-free

Save the file and exit nano by Ctrl + O then Enter and Ctrl + X

3.Add the repository public keys by running :

sudo gpg --keyserver pgpkeys.mit.edu --recv-key CCD91D6111A06851


 sudo gpg --armor --export CCD91D6111A06851 | apt-key add -

4.Update the package list :

sudo apt-get update

5.Install php7.0 :

sudo apt-get install php7.0 php7.0-dev

You can also install php extensions like this.

6.Check the version :

php -v
| improve this answer | |
  • 1
    It's been suggested by another user that php7.0-dev be added to the list. I don't know if that's necessary for building some pecl/pear modules. – goldilocks May 28 '17 at 14:21
  • Sorry, my mistake. I've approved that edit. – H G Sur Jun 15 '17 at 17:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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