tony1812
Posts: 349
Joined: Sat Jul 15, 2017 12:40 pm
Location: Boston MA.

php5 is not available

Sat Oct 21, 2017 12:33 am

Linux can drives one bunker ! This is not the first time it happened. Just two days ago, I installed Apache2 with phpmyadmin mysql on my pi. Today I tried to help my friend to do his, I use the same process, which contains sudo apt-get install libapache2-mod-php5 php5 php-pear php5-xcache php5-mysqlnd php5-curl php5-gd, it tells me that none of the php5-XXX is available. What the hell is going on? Why the apt-get changes from time to time? If they are updating it why can't they just make it remain available?

Milliways
Posts: 310
Joined: Fri Apr 25, 2014 12:18 am

Re: php5 is not available

Sat Oct 21, 2017 12:59 am

With the release of Stretch, Debian FINALLY got around to including php7, which has been in other distributions for years. The obsolete php5 is no longer included.

RonR
Posts: 274
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: php5 is not available

Sat Oct 21, 2017 1:48 am

tony1812 wrote:
Sat Oct 21, 2017 12:33 am
What the hell is going on? Why the apt-get changes from time to time? If they are updating it why can't they just make it remain available?
I just ran into the same problem after having php5 working with Stretch since Stretch was released (I cannot go to php7 as it's not supported by the software I'm installing). Apparently a number of Jessie packages were initially copied to the Stretch repository that shouldn't have been and they've now been removed. The simplest solution to the problem appears to be simply adding the following line to the end of /etc/apt/sources.list:

Code: Select all

deb http://mirrordirector.raspbian.org/raspbian/ jessie main contrib non-free rpi
I haven't done extensive testing yet, but everything looks good so far.

tony1812
Posts: 349
Joined: Sat Jul 15, 2017 12:40 pm
Location: Boston MA.

Re: php5 is not available

Sat Oct 21, 2017 1:12 pm

Thanks for the reply.
What I don't get is I used the same install process as I did for my friend.
Both OS are Stretch, from the same image. Mine installation leads no error. two days later, my friend's gave me this error.

RonR
Posts: 274
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: php5 is not available

Sat Oct 21, 2017 6:19 pm

tony1812 wrote:
Sat Oct 21, 2017 1:12 pm
What I don't get is I used the same install process as I did for my friend.
Both OS are Stretch, from the same image. Mine installation leads no error. two days later, my friend's gave me this error.
Your installation would also fail if you try it again now (without the change I suggested).

A decision was made not to provide php5 with Stretch since Stretch has moved up to php7. php5 packages were initially placed in the Stretch repository but were removed in the last couple of days. Now the only way to get php5 is to have apt access the Jessie repository by including the Jessie repository in /etc/apt/sources.list.

tony1812
Posts: 349
Joined: Sat Jul 15, 2017 12:40 pm
Location: Boston MA.

Re: php5 is not available

Sun Oct 22, 2017 6:19 pm

RonR wrote:
Sat Oct 21, 2017 6:19 pm
tony1812 wrote:
Sat Oct 21, 2017 1:12 pm
What I don't get is I used the same install process as I did for my friend.
Both OS are Stretch, from the same image. Mine installation leads no error. two days later, my friend's gave me this error.
Your installation would also fail if you try it again now (without the change I suggested).

A decision was made not to provide php5 with Stretch since Stretch has moved up to php7. php5 packages were initially placed in the Stretch repository but were removed in the last couple of days. Now the only way to get php5 is to have apt access the Jessie repository by including the Jessie repository in /etc/apt/sources.list.
It seems like they (whoever makes the decision) can do whatever at will, How do I keep track of their decisions?

Meanwhile, how do I install all these old php5-xyz stuffs? I tried just php-xyz, php7xyz, none of them works. Thanks

User avatar
DougieLawson
Posts: 33785
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: php5 is not available

Sun Oct 22, 2017 6:26 pm

Use apt-get search ... or apt search ... with the a portion of the package name. You can also use a regex like apt search php.*xyzzy

The changes between Jessie and Stretch were published long in advance on the DebIan website. Raspbian, mostly, follows DebIan.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

2012-18: 1B*5, 2B*2, B+, A+, Z, ZW, 3Bs*3, 3B+

Any DMs sent on Twitter will be answered next month.

RonR
Posts: 274
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: php5 is not available

Sun Oct 22, 2017 6:30 pm

tony1812 wrote:
Sun Oct 22, 2017 6:19 pm
Meanwhile, how do I install all these old php5-xyz stuffs? I tried just php-xyz, php7xyz, none of them works.
If you simply add the following line to the end of /etc/apt/sources.list, you will have no problem retrieving php5 packages with apt-get:

Code: Select all

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

Code: Select all

apt-get -y install php5 php5-curl php5-cli php5-mysql php5-gd
You may also need the following in order for applications to find php5 instead of php7:

Code: Select all

update-alternatives --set php /usr/bin/php5

User avatar
rpdom
Posts: 12803
Joined: Sun May 06, 2012 5:17 am
Location: Ankh-Morpork

Re: php5 is not available

Sun Oct 22, 2017 7:01 pm

RonR wrote:
Sun Oct 22, 2017 6:30 pm
tony1812 wrote:
Sun Oct 22, 2017 6:19 pm
Meanwhile, how do I install all these old php5-xyz stuffs? I tried just php-xyz, php7xyz, none of them works.
If you simply add the following line to the end of /etc/apt/sources.list, you will have no problem retrieving php5 packages with apt-get:

Code: Select all

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

Code: Select all

apt-get -y install php5 php5-curl php5-cli php5-mysql php5-gd
You may also need the following in order for applications to find php5 instead of php7:

Code: Select all

update-alternatives --set php /usr/bin/php5
However that should only be a temporary measure until you upgrade your code to php7. (or the applications you are relying on get upgraded to the current version.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 20447
Joined: Sat Jul 30, 2011 7:41 pm

Re: php5 is not available

Mon Oct 23, 2017 8:37 am

tony1812 wrote:
Sat Oct 21, 2017 12:33 am
Linux can drives one bunker ! This is not the first time it happened. Just two days ago, I installed Apache2 with phpmyadmin mysql on my pi. Today I tried to help my friend to do his, I use the same process, which contains sudo apt-get install libapache2-mod-php5 php5 php-pear php5-xcache php5-mysqlnd php5-curl php5-gd, it tells me that none of the php5-XXX is available. What the hell is going on? Why the apt-get changes from time to time? If they are updating it why can't they just make it remain available?
Do you specifically need PHP5? Because PHP7 should be available on Stretch, and you should use that in preference as its it has all recent security fixes.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Please direct all questions to the forum, I do not do support via PM.

token1
Posts: 1
Joined: Tue Dec 26, 2017 3:40 am

Re: php5 is not available

Tue Dec 26, 2017 3:48 am

Spent half a day following https://pestmeester.nl/index.html#10.0 pestmeester's guide I used years ago to build a working web server, but now finding about 50% of the tutorial being invalidated with I'm assuming updates to the Pi OS.

With that failing went to RasPi's very own tutorials: https://projects.raspberrypi.org/en/pro ... -wordpress. I guess its outdated and not updated.

I added the line to gain php5 back, but it still does not work. I cannot install php7 as well. Its very weird, but anyhow makes the whole project dead in the water. Doing the apt search does not bring up any php5 or 7 packages.

I thought the pi is for children and easy- its giving me ptsd flashbacks of typical linux googling sessions and dark google rabbit holes that eat an entire weekend and leave you with a paper weight.

RonR
Posts: 274
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: php5 is not available

Tue Dec 26, 2017 8:02 am

token1 wrote:
Tue Dec 26, 2017 3:48 am
I added the line to gain php5 back, but it still does not work.
Did you also execute the following after installing php5?

Code: Select all

update-alternatives --set php /usr/bin/php5
It should report:

update-alternatives: using /usr/bin/php5 to provide /usr/bin/php (php) in manual mode

PHP5 works as expected here.

User avatar
rpdom
Posts: 12803
Joined: Sun May 06, 2012 5:17 am
Location: Ankh-Morpork

Re: php5 is not available

Tue Dec 26, 2017 11:02 am

token1 wrote:
Tue Dec 26, 2017 3:48 am
With that failing went to RasPi's very own tutorials: https://projects.raspberrypi.org/en/pro ... -wordpress. I guess its outdated and not updated.
I've just gone through that tutorial and seen what changes are needed. It is a bit out of date. If I can figure out how to do a pull request for the documentation I will submit an updated version for review.

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 10918
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: php5 is not available

Tue Dec 26, 2017 1:44 pm

token1 wrote:
Tue Dec 26, 2017 3:48 am
I thought the pi is for children and easy-
Most children would not need to do the stuff you do. Its your choice if you use a PI for something its not intended for. Networking on a PI is based on the debian infrastructure, nobody claims its kids stuff.

oshiricohn
Posts: 1
Joined: Sat Sep 03, 2016 5:15 pm

Re: php5 is not available

Sun Mar 18, 2018 12:34 am

It appears that php5 was replaced by php7.0

Not php7

Also, php-apc is going to be a side trip, so I left it out and will add php-apcu later.

The command that worked is:

Code: Select all

sudo apt-get install nginx php7.0-fpm php7.0-curl php7.0-gd php7.0-cli php7.0-mcrypt php7.0-mysql mysql-server

Return to “Beginners”

Who is online

Users browsing this forum: dsmithp233 and 21 guests