Topic on Project:Support desk

PHP deprecated error after adding Lockdown extension

10
141.211.32.5 (talkcontribs)

I'm trying to force users to login to view special pages and recent changes. I added the Lockdown extension directory to /w/extensions/Lockdown. I then added these lines to my LocalSettings.php file.

require_once "$IP/extensions/Lockdown/Lockdown.php";
$wgSpecialPageLockdown['Export'] = array('user');
$wgSpecialPageLockdown['Recentchanges'] = array('user');
$wgSpecialPageLockdown['Specialpages'] = array('user');
$wgSpecialPageLockdown['Recentchangeslinked'] = array('user');

When I go to my wiki and click special pages I get a "500 - Internal server error". When I log in I'm able to go to special pages. I checked my error log and it says

[error] [dddf1fc1ccccd7df34f2ec09] /index.php?title=Special:SpecialPages   ErrorException from line 309 of C:\inetpub\wwwroot\TestWiki\w\includes\debug\MWDebug.php: PHP Deprecated: Use of User::makeGroupLinkWiki was deprecated in MediaWiki 1.29. [Called from array_map in (internal function)]

This did work in MediaWiki 1.26.

I'm now using 1.30 that was a fresh install not an upgrade. I'm also using PHP 7 and MySQL 5.7.

MarkAHershberger (talkcontribs)
141.211.32.5 (talkcontribs)

Thank you for the reply.

If I go back to 1.29 will this issue still occur? I have to demo it to some people in the next day or so. I doubt a fix will be made by then.

2001:16B8:1063:2D00:9C54:46CF:CEB7:838B (talkcontribs)

MediaWiki downgrades are not supported. You can disable output of PHP deprecated messages by adjusting the error_reporting setting of PHP.

MarkAHershberger (talkcontribs)

I've uploaded a fix. I think, though, that there must be another problem. A deprecation should not be fatal. Are there any other errors in your log?

141.211.32.5 (talkcontribs)

I cleared my log and clicked on the "Special Pages" link without being logged in. I checked the log for "[error]" and it found only one row with the same error message I posted before except the key is different.

There is this line which says it's an http error. Would this cause this issue?

[http] Error fetching URL: SSL certificate problem: unable to get local issuer certificate

How do I apply the fix you uploaded? Is there a file to replace? Thank you

MarkAHershberger (talkcontribs)

It is possible that the error you see is causing the problem, but I don't know enough to tell you.

If you click the link for my fix, you'll see a download link near the upper right. Click it and you'll see an option to get a tgz archive in the lower left archive of the box that appears.

This will provide you with a replacement for the lockdown extension for you to use.

141.211.32.5 (talkcontribs)

I'm still getting the same error. the tgz file didn't have a Lockdown.php file, is that correct?

I extracted the tgz into a new Lockdown directory and the error that Lockdown.php didn't exist appeared. So I used the original Lockdown and copied the files from the new Lockdown and it overwrote any matching files.

PHP Deprecated:  Use of User::makeGroupLinkWiki was deprecated in MediaWiki 1.29. [Called from array_map in (internal function)] in C:\inetpub\wwwroot\TestWiki\w\includes\debug\MWDebug.php on line 309

MarkAHershberger (talkcontribs)

There is no Lockdown.php in the new Lockdown. Reinstall the tgz file so that the files you copied aren't there anymore. Using the new Lockdown, but change your require_once statement to wfLoadExtension('Lockdown');

And, again, the deprecation notice shouldn't be the source of your problems. The source of your problem will most likely be labeled "fatal".

141.211.32.5 (talkcontribs)

That worked. I created a new Lockdown directory in extensions and put all the contents of the tgz file in it. I then edited my LocalSettings.php and commented out

#require_once "$IP/extensions/Lockdown/Lockdown.php";

and added

wfLoadExtension('Lockdown');

$wgSpecialPageLockdown['Export'] = array('user');

$wgSpecialPageLockdown['Recentchanges'] = array('user');

$wgSpecialPageLockdown['Specialpages'] = array('user');

$wgSpecialPageLockdown['Recentchangeslinked'] = array('user');

Now when I'm not logged in and I go to these pages it says that login is required.

Reply to "PHP deprecated error after adding Lockdown extension"