Last modified: 2012-10-21 02:15:19 UTC
I checked out the AntiSpoof extension and afterwards, while running the upgrade script, I got an error similar to the following: Warning: require(/home/path/w/__DIR__/AntiSpoofHooks.php): failed to open stream: No such file or directory in /home/path/w/includes/AutoLoader.php on line 1007 Fatal error: require(): Failed opening required '/home/path/w/__DIR__/AntiSpoofHooks.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/path/w/includes/AutoLoader.php on line 1007 I had to change the value from __DIR__ to dirname( __FILE__ ) . '/' to get the script to execute. Afterwards, running batchAntiSpoof.php, I got similar errors, clearly showing __DIR__ in the paths displayed. In addition, with the SimpleAntiSpam, for an example, with $wgShowExceptionDetails set to true, I saw Warning: include(__DIR__/SimpleAntiSpam.i18n.php) [function.include]: failed to open stream: No such file or directory in /home/path/w/includes/LocalisationCache.php on line 455 Warning: include(__DIR__/SimpleAntiSpam.i18n.php) [function.include]: failed to open stream: No such file or directory in /home/path/w/includes/LocalisationCache.php on line 455 Warning: include() [function.include]: Failed opening '__DIR__/SimpleAntiSpam.i18n.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/path/w/includes/LocalisationCache.php on line 455 These errors were resolved with the use of "dirname( __FILE__ ) . '/'" instead of "__DIR__". Would it be better to use "dirname( __FILE__ ) . '/'" in place of __DIR__ in all cases then? (Note: The wiki is on Linux OS and using an Apache server.)
PHP version error.
(In reply to comment #1) > PHP version error. Could you elaborate, e.g. which version you initially used and which version was needed?
From IRC: <Hazard-SJ> MatmaRex: The server in question uses PHP 5.2.17 __DIR__ was added in PHP 5.3.0.