Topic on Project:Support desk

Mediawiki : extensions files can't be loaded while filepath and permissions are correct

12
62.102.229.98 (talkcontribs)

Hello,

I'm migrating from mediawiki 1.21.3 to mediawiki 1.27.0 on a Ubuntu 16.04 with PHP 5.6. In my LocalSettings.php, I choose to keep the old method to call extensions, using include function. When I update with update.php, I have a bunch of error messages :

"failed to open stream : no such file or directory" 

However, first I'm absolutely sure about the path. Secondly, the extension folder belongs to www-data group and the files are chmod 777.

I really don't understand why I get a "no such file or directory" and I spent too much time searching an answer.

Does anyone has a clue ?

87.123.32.185 (talkcontribs)

What do your include/require_once lines look like?

Are you maybe relying on a spcial value of the include_path variable, which is different on the shell than in web server use?

62.102.229.98 (talkcontribs)

Hello,

My includes looks like this :

include("./extensions/anywebsite.php");

I don't know about "special value of the include_path variable".

Thanks for support.

87.123.32.185 (talkcontribs)

Try to change these lines so that they look like this:

require_once "$IP/extensions/anywebsite.php";

This should make sure that the correct file gets used...

62.102.229.98 (talkcontribs)

Nice, it seems to work, except for WikiEditor (same error message), but it is strange because the WYSIWYG actually works on the website.

87.123.41.248 (talkcontribs)

This should work with WikiEditor as well.

However, you also can disable WikiEditor, then run the update.php script and afterwards activate it again.

62.102.229.98 (talkcontribs)

Ok, actually this wasn't working for no extensions at all. I thought it worked because WikiEditor was the first extension called in LocalSettings.php so the script stopped and I just had the error message for WikiEditor.

My require_once look like this : require_once "./extensions/simplepie_mediawiki.php";

I'm sure of the path. The rights are permissive...

And the WYSIWYG actually works, so the problem is very strange.

AhmadF.Cheema (talkcontribs)

Shouldn't it be: require_once "$IP/extensions/simplepie_mediawiki.php";

with the "$IP"

62.102.229.98 (talkcontribs)

The $IP is no longer needed. According to the documentation "Setting this variable ($IP) to the absolute path to MediaWiki on disk from LocalSettings.php was necessary in older versions of MediaWiki. However, at least since MediaWiki 1.18, setting $IP in LocalSettings.php is no longer needed. It will default to the current working directory. If there is an environment variable named MW_INSTALL_PATH defined, its value will be used instead."

I'm in this case.

87.123.41.248 (talkcontribs)

What the docs say is that you do no longer have to define $IP - because MediaWiki now does that by itself. What the docs however do not say, is that $IP should no longer be used. Have a look at the examples on LocalSettings.php - they are using $IP as well.

87.123.41.248 (talkcontribs)

Ohh, you got that from Manual:$IP. I have updated this page to be more precise.

AhmadF.Cheema (talkcontribs)

I personally tried the . instead of $IP and there appeared to be no breaking problem. Apparently, the MediaWiki core syntax allows for it.

Tested this on about 15+ extensions.

Reply to "Mediawiki : extensions files can't be loaded while filepath and permissions are correct"