3.1dev upgrading to 3.5 - PHP7.0 install not seen by Moodle

3.1dev upgrading to 3.5 - PHP7.0 install not seen by Moodle

by Marvin Hamm -
Number of replies: 8

On Ubuntu 14.4. Have upgraded PHP to 7.0 on Ubuntu, but Moodle is still only seeing my PHP5. I can see in my Moodle's PHPInfo page that it is looking in my etc/php5 dir and PHP7 is installed to etc/php. How do I point moodle to PHP7?

Or am I not on the right track? I've read a suggestion to uninstall the php5 and install php7, but I don't know how that's going to change the wrong path in Moodle.

Marvin

Average of ratings: -
In reply to Marvin Hamm

Re: 3.1dev upgrading to 3.5 - PHP7.0 install not seen by Moodle

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

If Moodle says you are running PHP5 then it's probably true.

How to fix this depends on the operating system / hosting / how PHP was installed / how you switched or upgraded to PHP 7 and so on? More info needed?

In reply to Howard Miller

Re: 3.1dev upgrading to 3.5 - PHP7.0 install not seen by Moodle

by Marvin Hamm -

I did a command-line install of PHP7 in order to ready my machine to upgrade Moodle

At the command-line, php -ver returns:

    PHP 7.0.30-1+ubuntu14.04.1+deb.sury.org+1.....

That implies to me that PHP 7 is in fact successfully installed.

Moodle>site admin>server>php info shows:

    PHP version 5.5.9-1ubuntu4.25 and the path is /etc/php5/apache2/php.ini

In ubunu it appears that php5 is installed in /etc/php5 and php7 is installed in /etc/php

Since the machine can see php7 as primary, my assumption because of the value returned by php -ver at the command line and Moodle can't. I don't understand how removing PHP5 is going to some how goad Moodle into pointing to the /etc/php dir and use PHP7.


In reply to Marvin Hamm

Re: 3.1dev upgrading to 3.5 - PHP7.0 install not seen by Moodle

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Just be careful... command-line PHP and the PHP served through the web server are two completely different thing. The php command in version in no way implies the version served via the web.

In reply to Marvin Hamm

Re: 3.1dev upgrading to 3.5 - PHP7.0 install not seen by Moodle

by Alain Raap -
Picture of Particularly helpful Moodlers

I had the same problem in a Redhat environment with php56, removed all the rpm's of php56 and then I got php7 as the current working version in Moodle.

In reply to Alain Raap

Re: 3.1dev upgrading to 3.5 - PHP7.0 install not seen by Moodle

by Marvin Hamm -

RPM's? Not sure what that means.

Am I to understand that you just uninstalled PHP56 and then installed PHP7 and Moodle just saw the ver 7 and used it?

In reply to Marvin Hamm

Re: 3.1dev upgrading to 3.5 - PHP7.0 install not seen by Moodle

by Alain Raap -
Picture of Particularly helpful Moodlers

RPM’s are software packages to be installed on Redhat Linux.

I first installed php7 and then uninstalled php56, after the uninstall Moodle found php7.

In reply to Marvin Hamm

Re: 3.1dev upgrading to 3.5 - PHP7.0 install not seen by Moodle

by Ken Task -
Picture of Particularly helpful Moodlers

Question ... is there any reason for to keep php 5.5?   Have any legacy software on server that requires that version of PHP?  

Your moodle version is 3.1 and is compat with 7.0.x of PHP.

I've always heard that if one doesn't use something on a server, remove it - reduces the 'attack vectors/surface'.

If anything, this might be a good time to upgrade the OS to 16.04.  14.04 reaches EOL Apr 2019 - less than a year.  Never a good idea to run an OS that's no longer getting any fixes/updates for anything, IMHO.

'spirit of sharing', Ken


In reply to Marvin Hamm

Re: 3.1dev upgrading to 3.5 - PHP7.0 install not seen by Moodle

by Jerry Lau -

You need to change the association with the apache and php modules to point to the right one