Moodle Site Down after upgrading ubuntu from 14.04 to 16.04

Moodle Site Down after upgrading ubuntu from 14.04 to 16.04

by Richard Danvers -
Number of replies: 7

After upgrading my Linux server from ubuntu version 14.04 to 16.04 I seem to get back a php file in my browser whenever trying to access the site homepage:

php file

Any ideas? The moodle version is 3.1.4 


Thanks.

Average of ratings: -
In reply to Richard Danvers

Re: Moodle Site Down after upgrading ubuntu from 14.04 to 16.04

by Ken Task -
Picture of Particularly helpful Moodlers

if that's what you see, it's obvious that your php is broken and apache doesn't know what to do with .php files ... serves them out as text ... ie, doesn't execute PHP.

If the upgrade from 14.04 to 16.04 went well, you should be running php 7.0.x.

From the cli of the server, what does the following show:

php -v

php -m

** Think I'd uninstall whatever PHP version is there and then re-install it.

Can tell you this for sure ... your site if vulnerable right now and hackers could acquire info directly from config.php of the site ... if credentials for the DB are the same as the root user for your system, you've got big problems if not fixed immediately.   Might want to shut down apache first ... do the php re-install, then start up apache again.

'spirit of sharing', Ken

In reply to Ken Task

Re: Moodle Site Down after upgrading ubuntu from 14.04 to 16.04

by Richard Danvers -
Thanks for the response, i've just checked to see what version it was on (if any) and it returned with the correct version of PHP. Is there any other reasons this error may occur.


Here is the returned result.

php version


Thanks.

In reply to Richard Danvers

Re: Moodle Site Down after upgrading ubuntu from 14.04 to 16.04

by Ken Task -
Picture of Particularly helpful Moodlers

That shows you have php7.0-cli (command line) ... what of the other command suggested you run: php -m?

If you had the php extensions required by Moodle to run the php -v should have shown three of lines about Zend.

And php -m would scroll showing all the modules installed.

Think one should issue:

apt-get install php7.0-common

at least to get started with the extensions.   That will install most of the php extensions.

See: https://docs.moodle.org/33/en/PHP

'spirit of sharing', Ken

In reply to Ken Task

Re: Moodle Site Down after upgrading ubuntu from 14.04 to 16.04

by Richard Danvers -

PHP -M returned the following modules..


php modules


I've just had a go with the command and I receive the zen command when i run php -v  (think i did before but ommitted as I didn't realise it was of importance), still seem to be having the same issues.

In reply to Richard Danvers

Re: Moodle Site Down after upgrading ubuntu from 14.04 to 16.04

by Ken Task -
Picture of Particularly helpful Moodlers

Missing the extensions for mysql ...

apt-get install php7.0-mysql

There is a command to search repos ... apt-cache search php7.0

You want only the ones listed as php7.0-X where X is the extension.

Will show what's not installed ... ie available to install.   Compare that list with the link provided earlier for php modules needed to run moodle.

After installation of the extensions, check with php -m and then restart apache service.

'spirit of sharing', Ken

In reply to Richard Danvers

Re: Moodle Site Down after upgrading ubuntu from 14.04 to 16.04

by Mahinwal Surya -

I am sure you lost your PHP or LAMP at the time of Ubuntu upgrade. 

Follow some steps to find the problem.

Type `which php` command on terminal. If you have PHP in your system then it will return path of PHP.

PHP version command: php -v ( it will return version of PHP)

NOTE: Don't forget Moodle 3.x require at least PHP 5.6 and above.

For better understanding please check here https://docs.moodle.org/26/en/Step-by-step_Installation_Guide_for_Ubuntu 


Thanks


In reply to Mahinwal Surya

Re: Moodle Site Down after upgrading ubuntu from 14.04 to 16.04

by Richard Danvers -
I've just had a look and I still seem to have php installed with the correct version (7+).