1

I can't install PHP on my raspberry pi. I did sudo apt-get install php libapache2-mod-php php-mcrypt and then showed me this:

Reading state information... Done
E: Unable to locate package php
E: Unable to locate package libapache2-mod-php
E: Unable to locate package php-mcrypt

On my sources.list I got this:

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

I don't know what to do

1
  • It should be apache2-mod-php5. But you should really upgrade from Jessie to Stretch and install php7. php-crypt is deprecated and removed from php7.1.
    – hcheung
    Commented Feb 1, 2018 at 12:45

2 Answers 2

1

Try to run sudo apt update first and see how it goes and if possible post the ping mirrordirector.raspbian.org result for the RPI3 on paste.debian.net and give us the link. There is no package exactly named php but the php package available is as php7.0. So you are supposed to run sudo apt install php7.0 instead of sudo apt install php and you can always search for a package (apt will intelligently show relevant or closely related package names if the exact match is not found) by apt search package_name

2
  • thanls mate, really helped, i have another question but i dont know why i cant post it. can i ask you here by a comment? only if you are agree with it. (its about my GPIO, its giving me 1.2 v not 3.3v ) Commented Feb 1, 2018 at 20:52
  • @FreddyAlexSaavedra not a pro on that, sorry and you supposed to be able to ask new questions as you have asked already. Commented Feb 2, 2018 at 8:19
3

i used

sudo apt-get install php5 libapache2-mod-php5 -y

it works ok for me

1
  • 3
    RIP php5 ....
    – Milliways
    Commented May 25, 2018 at 9:59

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