Topic on Project:Support desk

transformFilePath() or path problem

3
77.108.66.140 (talkcontribs)

Hi, I have just install mediawiki-1.29.0 ( tryed 1.28.2, before... - same problem) on localhost OpenServer 5.2.2.

After sucessful instalation I copied LocalSettings.php, opened the start page and got the error:

Warning: md5_file(D:\soft\OpenServer64\OpenServer\domains\mediawiki/../resources/assets/wiki.png): failed to open stream: No such file or directory in D:\soft\OpenServer64\OpenServer\domains\mediawiki\includes\OutputPage.php on line 3802

Warning: OutputPage::transformFilePath: Failed to hash D:\soft\OpenServer64\OpenServer\domains\mediawiki/../resources/assets/wiki.png [Called from OutputPage::transformFilePath in D:\soft\OpenServer64\OpenServer\domains\mediawiki\includes\OutputPage.php at line 3804] in D:\soft\OpenServer64\OpenServer\domains\mediawiki\includes\debug\MWDebug.php on line 309

after this i make test file:

 <?php $hash = md5_file( "D:\soft\OpenServer64\OpenServer\domains\mediawiki\resources\assets\mediawiki.png" );

  echo $hash ?>

- same error

 <?php $hash = md5_file( "http://mediawiki/resources/assets/mediawiki.png" );

  echo $hash ?>

- without errors, md5_file is working

Why wediawiki using local paths ? it's normaly ?

how can I test transformFilePath() from OutputPage.php ?

I am a beginner in MW, please help me to start it.

Any advice would be appreciated, thanks

77.108.66.140 (talkcontribs)
Ciencia Al Poder (talkcontribs)

backslash ( "\" ) is an escape character in strings in PHP. Try replacing them in paths using the forward slash instead ( "/" ) as PHP will convert them appropriately on Windows:

md5_file( "D:/soft/OpenServer64/OpenServer/domains/mediawiki/resources/assets/mediawiki.png" );