BOM breaking PHP in Mediawiki code

Post your questions and problem reports here

Moderator: kfury77

Forum rules
Please try to follow these guidelines. This will help to receive faster and more accurate response.
  • Check the Support section of the corresponding product first. Chances are you will find your answer there;
  • Do not create new topics for already reported problems. Add your comments to the existing topics instead;
  • Create separate topic for each problem request. Do NOT post a number of non-related problem reports in a single topic;
  • Give your topic a meaningful title. Titles such as "A question," "Bug report" and "Help!" provide others no clue what your message is about;
  • Include the version number of the software you are using;
  • This is not an official customer support helpdesk. If you need a prompt and official response, please contact our support team directly instead. It may take a while until you receive a reply in the forum;
Post Reply
NCBuyer
Posts: 5
Joined: Thu Mar 07, 2013 7:05 am

BOM breaking PHP in Mediawiki code

Post by NCBuyer »

Greetings,

I just installed Mediawiki on a local network and I have to edit some PHP files. The first one I tried to edit "LocalSettings.php" was saved and when I refreshed the site I received a blank page. Upon seeking answers from Mediawiki's forum, I found this advice:
Most likely, your text editor added a byte order mark (BOM) while you edited MediaWiki's PHP files, but any other content before the opening <?php causes the same problem. This usually happens with LocalSettings.php - but see error message for exact file. Note that BOMs are invisible in most text editors. To remove the BOM, edit the file with something better than Windows Notepad, but if you don't really have time - open the file with it and choose Save as..., then choose "Unicode (UTF-8 Without signature) - Codepage 65001" as file type.
Well I hope that Webuilder is "better than Windows notepad" as the author suggests! :D I bought this editor because I will be needing to edit a lot of this PHP and with my very first edit/save I broke the site due to some characters that I cant even see.

Please tell me that I can save this file such that it doesnt break the website (i.e. remove the BOM). I have tried to save the PHP with encoding "UTF-8 without BOM" but I receive the same blank screen. If I replace the original LocalSettings.php file with the one which came with the install (vanilla version), my site works again.

Any ideas??
User avatar
Aivars
Blumentals Software Developer
Posts: 2462
Joined: Thu Aug 22, 2002 1:40 pm
Location: Latvia

Re: BOM breaking PHP in Mediawiki code

Post by Aivars »

UTF8 without BOM is the correct encoding you need to use. Please try again and make sure you have selected it. If this basic feature wouldn't be working then our support would have been drowned in bug reports by now.

Blank page in PHP can also happen if you have syntax error in your PHP script and you have configured PHP to not display error messages but log them.
Blumentals Software Programmer
NCBuyer
Posts: 5
Joined: Thu Mar 07, 2013 7:05 am

Re: BOM breaking PHP in Mediawiki code

Post by NCBuyer »

I took an original copy of the file and restored it. I then saved (no coding changes) the file as UTF8 without BOM and the site stayed up/ok.

I made the required edit given to me by the extension developer and saved it again and the site is blank. So it must be something with the block of code they want me to add.

Thank you for your help and your reply! I will focus on asking my question at their forum now.

-NC
Post Reply