Reputation: 43
I'm trying to install the MediaWiki in a shared host of my university. The url will be http://www.iq.usp.br/mcplwiki. I've put the MediaWiki files in the web folder (I'm using the WinSCP to access the folders), so I should be able to access and finish the installation by going to this url, right?
But when I do so, I receive a downloaded file with this content:
This is the main web entry point for MediaWiki.
*
* If you are reading this in your web browser, your server is probably
* not configured correctly to run PHP applications!
I've checked the PHP version with the IT service, and the version is 5.3.3-7, which should be enough for the latest MediaWiki version.
Can you guys help me? Thanks!
Upvotes: 3
Views: 2852
Reputation: 4142
I came across this issue after upgrading my php installed version.
For my case, I looked in /etc/apache2/mods-available to find the php module name:
$ sudo ls /etc/apache2/mods-available/php*
/etc/apache2/mods-available/php7.4.conf /etc/apache2/mods-available/php8.2.conf
/etc/apache2/mods-available/php7.4.load /etc/apache2/mods-available/php8.2.load
I enabled the latest version like so:
$ sudo a2enmod php8.2
And restarted my apache2 service:
$ systemctl restart apache2
Then I reloaded the home page in my web browser and the php rendered properly.
Upvotes: 0
Reputation: 11
Please specify clearly by giving an example that what is x.x in above command
apt-get install libapache2-mod-phpX.X
x.x is your php version which you can get by following command
php -v
and for a version like 7.4 the command will be
apt-get install libapache2-mod-php7.4
Upvotes: 1
Reputation: 691
The issue I had was that apache2
did not have a PHP module enabled.
These are the steps I took to diagnose and fix my issue:
Check that you have PHP: php -v
Check if you have a PHP module enabled in apache: apachectl -M
If you don't have a PHP module, install one for your PHP version: apt-get install libapache2-mod-phpX.X
Reload: service apache2 reload
Upvotes: 2
Reputation: 1687
There are a few possible causes...
Check the PHP and Apache error files. The fact that you are seeing the message showing up would tend to indicate to me that it could even be an issue with running PHP from your account with the shared hosting. As a test try uploading a file and add to it something simple like
<?php
echo("PHP Works");
?>
By doing this test you will be able to confirm if the issue is a configuration error preventing PHP from working at all, or if there is some permission error which is preventing certain required includes from being accessed. If the test file works then check the PHP error log, if it doesn't then chances are PHP won't have any errors and you will need to have IT services check the configuration and confirm that PHP is supported on your specific account.
Upvotes: 1