Larissa
Larissa

Reputation: 43

MediaWiki installation problems

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

Answers (4)

Razzi Abuissa
Razzi Abuissa

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

Kaustubh Rai
Kaustubh Rai

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

Cyrus
Cyrus

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:

  1. Check that you have PHP: php -v

  2. Check if you have a PHP module enabled in apache: apachectl -M

  3. If you don't have a PHP module, install one for your PHP version: apt-get install libapache2-mod-phpX.X

  4. Reload: service apache2 reload

Upvotes: 2

Chris Rutherfurd
Chris Rutherfurd

Reputation: 1687

There are a few possible causes...

  1. PHP Safe Mode - Safe mode was depreciated in PHP v5.3 and has been known to cause issues with MediaWiki, speak to IT services about disabling it as it has been depreciated and as of PHP v 5.4 has been removed and is no longer supported.
  2. Permission Error - There have been instances I have been aware of where the index.php file has been owned for some reason by user ID "0" which is the root user and the other files have been owned by another user (normally yourself) which can cause issues, ensure that all files in your installation are owned by yourself.

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

Related Questions