Install php7.1 and php7.2

Having issues with your DietPi installation, or, found a bug? Post it here.
Post Reply
baboon
Posts: 2
Joined: Tue Feb 20, 2018 8:53 pm

Install php7.1 and php7.2

Post by baboon »

Hi everyone,

I have searched on the forum and online but have not found an answer to my question.
I am currently on the latest version of dietpi, fresh install on Rock64 board. Untill v159 i had no issues whatsoever but since i upgraded i have come across few things that i might need some help with.

1. How come there is no LAMP server anymore? (there was until v159)
Now:
lamp
lamp
Capture1.PNG (7.34 KiB) Viewed 2642 times
2. The main question i am writing about. The server stacks come with php7.0 installed and configured.
Regarding php7.1 and php7.2 most of the tutorials and recommendations are to use the packages.sury.org/php packages.
Well, when i add the repository (for debian) and

Code: Select all

sudo apt update
it shows some php modules can be updated but it wont undate them. then when i try to instal either 7.1 or 7.2 I get the following errors:

Code: Select all

root@DietPi:~# sudo apt update
Get:1 http://deb.ayufan.eu/orgs/ayufan-rock64/releases  InRelease [1249 B]
Hit:2 https://packages.sury.org/php stretch InRelease
Ign:3 https://cdn-aws.deb.debian.org/debian stretch InRelease
Hit:4 https://cdn-aws.deb.debian.org/debian stretch-updates InRelease
Hit:5 https://cdn-aws.deb.debian.org/debian-security stretch/updates InRelease
Hit:6 https://cdn-aws.deb.debian.org/debian stretch-backports InRelease
Hit:7 https://cdn-aws.deb.debian.org/debian stretch Release
Fetched 1249 B in 3s (364 B/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
9 packages can be upgraded. Run 'apt list --upgradable' to see them.
root@DietPi:~# apt list --upgradable
Listing... Done
php-curl/unknown 1:7.2+59+0~20180122053946.6+stretch~1.gbp70c3ba all [upgradable from: 1:7.0+49]
php-fpm/unknown 1:7.2+59+0~20180122053946.6+stretch~1.gbp70c3ba all [upgradable from: 1:7.0+49]
php-gd/unknown 1:7.2+59+0~20180122053946.6+stretch~1.gbp70c3ba all [upgradable from: 1:7.0+49]
php-intl/unknown 1:7.2+59+0~20180122053946.6+stretch~1.gbp70c3ba all [upgradable from: 1:7.0+49]
php-mbstring/unknown 1:7.2+59+0~20180122053946.6+stretch~1.gbp70c3ba all [upgradable from: 1:7.0+49]
php-mcrypt/unknown 1:7.2+58+0~20180114065947.5+stretch~1.gbp62db77 all [upgradable from: 1:7.0+49]
php-mysql/unknown 1:7.2+59+0~20180122053946.6+stretch~1.gbp70c3ba all [upgradable from: 1:7.0+49]
php-xml/unknown 1:7.2+59+0~20180122053946.6+stretch~1.gbp70c3ba all [upgradable from: 1:7.0+49]
php-zip/unknown 1:7.2+59+0~20180122053946.6+stretch~1.gbp70c3ba all [upgradable from: 1:7.0+49]
root@DietPi:~# sudo apt upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
root@DietPi:~# apt install php7.1
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 php7.1 : Depends: libapache2-mod-php7.1 but it is not installable or
                   php7.1-fpm but it is not installable or
                   php7.1-cgi but it is not installable
          Depends: php7.1-common but it is not installable
E: Unable to correct problems, you have held broken packages.
root@DietPi:~# apt install php7.2
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 php7.2 : Depends: libapache2-mod-php7.2 but it is not installable or
                   php7.2-fpm but it is not installable or
                   php7.2-cgi but it is not installable
          Depends: php7.2-common but it is not installable
E: Unable to correct problems, you have held broken packages.
Why wont i be able to install other php versions, and why it would say i have broken packages?
I think it has something to do with the current set up of dietpi since on version v159 and before it worked with no issues.
Even after installing nextcloud, some addons require php7.1 to be installed, so i would assume i should be able to install it somehow.

It could be that i am missing something, but it bugs me and if anyone has an opinion id be glad to hear it :)
User avatar
johnvick
Legend
Posts: 693
Joined: Wed Jun 08, 2016 11:53 am
Location: New Zealand

Re: Install php7.1 and php7.2

Post by johnvick »

Question 1 - in Debian Stretch MySQL has been replaced by MariaDB - if you use this option - LLAP - you should not notice any difference from using MySQL.

John
baboon
Posts: 2
Joined: Tue Feb 20, 2018 8:53 pm

Re: Install php7.1 and php7.2

Post by baboon »

Thank you for that answer.

Is there really noone that has tried to install php7.1 or php7.2 on DietPi since v6.0?

Cheers
User avatar
MichaIng
Site Admin
Posts: 2262
Joined: Sat Nov 18, 2017 6:21 pm

Re: Install php7.1 and php7.2

Post by MichaIng »

We added php7.2 due to Debian Buster support, as it is default PHP version there, but so far it is not intended to use with Stretch.

But it is not too much to do btw. with Ondrejs repo and copy some of the config files from 7.0 config.

I was already thinking, that during our PHP installation we could apply settings to PHP version, based simply on available folders. If /etc/php7.0 is there, we apply settings there, if /etc/php7.2 is available as well (due to manual PHP7.2 installation from Ondrejs repo), then we apply settings there as well.
sims
Posts: 1
Joined: Wed Jun 06, 2018 12:18 pm

Re: Install php7.1 and php7.2

Post by sims »

Any instructions on how to update php to a recent version?
Post Reply