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:
Any ideas? The moodle version is 3.1.4
Thanks.
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
Here is the returned result.
Thanks.
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
PHP -M returned the following 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.
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
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