A partial archive of https://discourse-mediawiki.wmflabs.org as of Saturday May 21, 2022.

Cannot create special page - “Failed opening required …”

desperate

Hi,
i am not able to create my own special page. Especially not to extend the autoload class. It throws the following error

Fatal error: require(): Failed opening required ‘C:\xampp\htdocs\mediawiki/extensions/MyExtension/SpecialMyExtension_body.php’ (include_path=‘C:\xampp\htdocs\mediawiki\vendor/pear/pear_exception;C:\xampp\htdocs\mediawiki\vendor/pear/console_getopt;C:\xampp\htdocs\mediawiki\vendor/pear/mail_mime-decode;C:\xampp\htdocs\mediawiki\vendor/pear/net_smtp;C:\xampp\htdocs\mediawiki\vendor/pear/pear-core-minimal/src;C:\xampp\htdocs\mediawiki\vendor/pear/mail;C:\xampp\htdocs\mediawiki\vendor/pear/mail_mime;C:\xampp\htdocs\mediawiki\vendor/pear/net_socket;C:\xampp\php\PEAR’) in C:\xampp\htdocs\mediawiki\includes\AutoLoader.php on line 81

I’m very desperate because it is part of my master thesis, so i would be very very thankful if anyone could help me ot. Thanks a lot!

Osnard

Well, does the file C:\xampp\htdocs\mediawiki/extensions/MyExtension/SpecialMyExtension_body.php exist in that location? Is your extension really called “MyExtension”? Maybe you just forgot to change the path.

desperate

Thanks a lot! the file name was MyExtension and not SpecialMyExtension… :woman_facepalming:

desperate

do you have any idea if it is possible to extend the special page create user account and connect it to my own db?

Tgr

In general using file names which end with _body is a bad idea; MediaWiki is trying to move away from that convention and towards embracing PSR-4 where your file names match your class names (so if the class is called SpecialMyExtension, or better MediaWiki\Extensions\MyExtension\SpecialMyExtension, then the file path would be something like src/SpecialMyExtension.php).

(Please start a new thread if you have another question; that makes questions and answers easier to find for future readers of this forum and helps avoiding duplicate questions.)

desperate

Thanks for the advice! I did open a new thread but unfortunateky didn’t get any reply yet…

addshore

Can we get this post marked as resolved with the first answer? :slight_smile: