Web lists-archives.com

Re: Upgraded to stretch but apache2 still uses php5

On 04/12/17 04:51 AM, x9p wrote:
The downside of upgrading php5 -> php7 is.. some apps can break. Still,
there are some workarounds to make them work with php7 (most of cases).

check if you have libapache2-mod-php7.0 installed. remove/purge any other
previous versions of this package and restart apache2.

I had both installed:

# dpkg --get-selections |grep libapache2-mod-php
libapache2-mod-php5                             install
libapache2-mod-php7.0                           install

after that, check if there is still something there with:

# egrep -rs php5 /etc/apache2/
# egrep -rs php5 /etc/apache2/
/etc/apache2/mods-available/php7.0.load:# Conflicts: php5
/etc/apache2/mods-available/php5.load:LoadModule php5_module /usr/lib/apache2/modules/libphp5.so

It didn't seem necessary to uninstall any php5, so I did this:

 # a2dismod php5
 # a2enmod php7.0
 # systemctl restart apache2

Now apache2 is using php7.0, and the apps that I checked all seem to work. I re-installed roundcube and installed the missing dependency php-net-idna2 ( https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=866895 ) and now roundcube works!

Just curious, should the upgrade to stretch have done this for me or is it known that this switch is to be done manually?

Thanks for the help!


also in hole system:

dpkg -l | egrep php5

If so, repeat process of upgrade the packages, restart apache2

PS: Assuming your apps works with php7



I thought I'd try a better webmail than squirrelmail, so I tried to
install roundcube. After many hours I gave up (missing php pdo modules),
purged it all, and then tried a non-debian package: rainloop. I spent
may hours with it, trying to solve missing php curl modules.
What had me going in circles in both cases was that php was telling me
that the missing modules were in fact there.
I finally realized that the php cli is v7.0, whereas apache2 runs runs
with php5. There are all sorts of apache2 config files for php7 but
apache2 is still using php5. php7 has the pdo and curl modules, but I
think the php5 modules were uninstalled during the upgrade to stretch. I
don't know if it is intentional that the apache2 environment didn't
change to the newer php7? If it should be using php7, how do I go about
forcing the change, and is there any downside to doing this?