herace
Posts: 5
Joined: Sat Jan 13, 2018 7:12 pm

How can I update from PHP 7.0 to PHP 7.1?

Tue Jun 18, 2019 11:33 am

My /etc/apt/sources.list file:

Code: Select all

deb http://raspbian.raspberrypi.org/raspbian/ stretch main contrib non-free rpi
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
deb-src http://raspbian.raspberrypi.org/raspbian/ stretch main contrib non-free rpi
I installed PHP 7.0 it with:

Code: Select all

sudo apt-get install apache2 php7.0 php7.0-curl php7.0-gd php7.0-imap php7.0-json php7.0-mcrypt php7.0-mysql php7.0-opcache php7.0-xmlrpc libapache2-mod-php7.0
php -v output:

Code: Select all

PHP 7.0.33-0+deb9u3 (cli) (built: Mar  8 2019 10:01:24) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
    with Zend OPcache v7.0.33-0+deb9u3, Copyright (c) 1999-2017, by Zend Technologies
How can I update from 7.0 to 7.1?

User avatar
topguy
Posts: 5569
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: How can I update from PHP 7.0 to PHP 7.1?

Tue Jun 18, 2019 12:09 pm

Why 7.1 ? Next Debian ( and probably Raspbian ) release called "Buster" will get 7.3 as far as I can google.

There will (probably) not be a PHP7.1 in the official repositories, so I geuss your options are:
- google if someone has backported 7.1 for Raspbian Stretch and has a repository you can install from.
- dowload sourcecode and compile and install it yourself.
- see if Raspbian has a "buster" pre-release/testing repository with PHP 7.3 and do a partial upgrade.

All these options are potential breaking of your system so first take a backup and be prepared to reinstall everything from scratch if needed.

User avatar
rpdom
Posts: 14460
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: How can I update from PHP 7.0 to PHP 7.1?

Tue Jun 18, 2019 12:11 pm

You have a choice. You can remove your current php7.0 and all associated packages and build from source.

Or, you can wait a few months until Raspbian Buster is released with php7.3.

Or (only slightly dodgy now) run a mixed system with some packages from Buster and the rest from Stretch. A little bit of fiddling with files is required to prioritise Stretch over Buster and force installation of certain packages from Buster, but it does work. Not recommended if you aren't very experienced in the way that Debian packing works.

Why do you need php7.1?

efftee
Posts: 7
Joined: Wed Jul 10, 2019 8:15 pm

Re: How can I update from PHP 7.0 to PHP 7.1?

Thu Jul 11, 2019 8:10 am

Using an RPi3B+ to host a Nextcloud instance, the current version upgrade of Nextcloud requires at least php7.2.
Soon enough 7.0 will be unsuported...

So there are good reasons to upgrade 7.0 to 7.3.

Upgrading Stretch to Buster entirely (seemingly the easy way out of building the new php), doesn't work. I've tried it, and it generates a whole series of unwanted problems that are rough to deal with... I'm reverting to my backup now. (Stretch with php7.0).

There are no serious ressources from google to guide anyone through upgrading php7.0 to 7.3.
It would be very much appreciated if anyone with the knowledge (and the time), could write some kind of a walk-through...
;)


fruitoftheloom
Posts: 19799
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: How can I update from PHP 7.0 to PHP 7.1?

Thu Jul 11, 2019 8:28 am

efftee wrote:
Thu Jul 11, 2019 8:17 am
Well there is this :

https://ayesh.me/Ubuntu-PHP-7.3


Raspbian Buster has PHP7.3 in repositories version 7.3.4
adieu

My other Computer is an Asus CS10 ChromeBit running Chrome Operating System.
HP Envy 4500 Wireless Printer supported by HPLIP software in Raspbian Buster.
Raspberry Pi Model 2B v1.1

efftee
Posts: 7
Joined: Wed Jul 10, 2019 8:15 pm

Re: How can I update from PHP 7.0 to PHP 7.1?

Thu Jul 11, 2019 9:03 am

fruitoftheloom wrote:
Thu Jul 11, 2019 8:28 am
efftee wrote:
Thu Jul 11, 2019 8:17 am
Well there is this :

https://ayesh.me/Ubuntu-PHP-7.3


Raspbian Buster has PHP7.3 in repositories version 7.3.4
Considering full upgrade from stretch to buster is a. VERY bad idea on a RPi3,
How would you configure aptitude to fish in Buster repositories for php. only ?

Switch to Buster repositories, and only upgrade php. ?

fruitoftheloom
Posts: 19799
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: How can I update from PHP 7.0 to PHP 7.1?

Thu Jul 11, 2019 9:12 am

efftee wrote:
Thu Jul 11, 2019 9:03 am
fruitoftheloom wrote:
Thu Jul 11, 2019 8:28 am
efftee wrote:
Thu Jul 11, 2019 8:17 am
Well there is this :

https://ayesh.me/Ubuntu-PHP-7.3


Raspbian Buster has PHP7.3 in repositories version 7.3.4
Considering full upgrade from stretch to buster is a. VERY bad idea on a RPi3,
How would you configure aptitude to fish in Buster repositories for php. only ?

Switch to Buster repositories, and only upgrade php. ?

IMO it is best to start with a fresh install of Raspbian Buster, mixing sources can lead to dependency hell !
adieu

My other Computer is an Asus CS10 ChromeBit running Chrome Operating System.
HP Envy 4500 Wireless Printer supported by HPLIP software in Raspbian Buster.
Raspberry Pi Model 2B v1.1

efftee
Posts: 7
Joined: Wed Jul 10, 2019 8:15 pm

Re: How can I update from PHP 7.0 to PHP 7.1?

Thu Jul 11, 2019 9:35 am

I agree.

However, starting a fresh install because a php upgrade is needed sounds like an overkill .... :shock:

User avatar
topguy
Posts: 5569
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: How can I update from PHP 7.0 to PHP 7.1?

Thu Jul 11, 2019 11:31 am

Being prepared for a full reinstall is something everyone should be, an SD card can break at any time.
Having done it before and noting down all the necessary steps is a great exercise.

jerrm
Posts: 84
Joined: Wed May 02, 2018 7:35 pm

Re: How can I update from PHP 7.0 to PHP 7.1?

Thu Jul 11, 2019 2:25 pm

The sury.org packages listed in the above ayesh.me link should work. He has 7.1, 7.2. & 7.3 packages targeted for stretch.

Follow the Debian instructions, not the ubuntu, don't fret that there is no "Raspbian" target, the debian armhf packages work on Raspbian.

I use the sury.org packages on Raspbian.

Return to “Networking and servers”