Project:Support desk/Sections/PHP

__NEWSECTIONLINK__

= PHP Error Support =

Move wiki to new server with current MW, Fatal PHP error

 * MediaWiki version: 1.13.3
 * PHP version: 5.1.6-20
 * MySQL version: 5.0.45-7
 * URL: Classified (very literally, not a joke! ;-) )
 * OS: RHEL5

I need to move a wiki (1.10.0) from one machine to another, and at the same time upgrade MW to 1.13.3 After untarring MediaWiki, copying the contants of /images and restoring the database, attempting to access the wiki results in an error:

[Tue Jan 20 19:48:14 2009] [error] [client 192.168.1.2] PHP Fatal error: require_once [function.require]: Failed opening required '/var/www/html2/wiki/ LocalSettings.php' (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/html2/wiki/ includes/WebStart.php on line 97

[RESOLVED] Problem parsing EXIF data with foreign file repository

 * MediaWiki version: 1.14.0
 * PHP version: 5.2.6
 * MySQL version: 5.0.81-community
 * URL: http://wiki.jnsforum.com/wiki/File:Yurakucho0953.jpg

I have enabled $wgForeignFileRepos to use images from Wikimedia Commons, and while this functionality works generally, many images produce the following error: Warning: preg_match expects parameter 2 to be string, array given in /home/jnsforum/public_html/jnswiki/includes/Exif.php on line 1086 several times; additionally, none of the EXIF data will display. —CaptOblivious 20:56, 10 June 2009 (UTC)


 * Upgrading to 1.15.0 fixed the issue entirely. --CaptOblivious 20:39, 24 June 2009 (UTC)

Parse error after changing logo

 * MediaWiki version: 1.15.0
 * PHP version: 5.2.6
 * MySQL version: 4.1.22-standard
 * URL: dbdawiki.xtremeaghosting.com/wiki.php5

I am trying to change the logo on my wiki page and I have done what it has said on the help pages but I am still getting a Parse error: syntax error, unexpected $end in /home2/dbdaw/public_html/wiki/LocalSettings.php on line 125. I am not sure what I am doing wrong but I would like to get this figured out.

—71.158.223.96 00:33, 14 June 2009 (UTC)


 * Please remember to set an informative section title when posting threads here. That's an interesting problem.  How many lines is your LocalSettings file?  Does the problem go away when you remove or comment out the logo declaration? Happy ‑ melon 08:45, 14 June 2009 (UTC)
 * A common error is to forget the ";" at the end of the statement. You need to use  instead of  . i Alex  11:22, 14 June 2009 (UTC)

says I need to move config/LocalSettings.php to parent directory

 * MediaWiki version:
 * PHP version:
 * MySQL version:
 * URL:

How do I locate this parent directory and how do I "move" config/LocalSettings.php to parent directory? I have Vista —75.84.213.176 08:21, 26 June 2009 (UTC)


 * Your MediaWiki installation is in a folder somewhere, call it path/to/mw. Within that folder, MediaWiki is organised into a number of folders, like /includes, /api, etc.  One of these folders is called /config, and contains your newly-created LocalSettings.php.  You need to move this file from path/to/mw/config/LocalSettings.php to path/to/mw/LocalSettings.php to complete the installation. This is a security check to ensure that the person installing the wiki has shell access to the web server. Hope this clarifies. Happy ‑ melon 17:41, 28 June 2009 (UTC)

[RESOLVED] Using MediaWiki 1.15.0 with PHP 5.3.0

 * MediaWiki version: 1.15.0
 * PHP version: 5.3.0
 * MySQL version:
 * URL: http://www.50er-forum.de

I'm using MediaWiki 1.15.0. The server, on which my MediaWiki is installed, has been updated to PHP 5.3.0 and now I have some trouble with it. Before the PHP update all URLs had the usual structure like http://www.50er-forum.de/wiki/index.php/Hauptseite. But now all URLs have this structure: http://www.50er-forum.de/wiki/index.php?title=Hauptseite.

If one manually enters the URL of a subpage like http://www.50er-forum.de/wiki/index.php/Subpage, he's automatically redirected to the Main Page (http://www.50er-forum.de/wiki/index.php?title=Hauptseite).

So, the former structure of the URLs before the PHP update doesn't work anymore as it did before.

Is this a general problem of MediaWiki 1.15.0 with PHP 5.3.0 or do only I in my wiki have that problem?

Thanks in advance. --Plati123 16:04, 7 July 2009 (UTC)
 * This can be the case if PHP's SAPI changed (which is now "cgi-fcgi" and disables short urls), but you can force by setting  in LocalSettings.php. i Alex  16:38, 7 July 2009 (UTC)
 * Thank you very much, it works fine. ;) --Plati123 17:16, 7 July 2009 (UTC)

Mail error: unable to connect to SMTP server

 * MediaWiki version: 1.5.8
 * PHP version: 5.2.9
 * MySQL version: 5.1.32
 * URL: Internal Only :\

I am trying to setup MediaWiki with WAMP and for the life of me, I cannot figure out how to confirm the email settings so I don't get the following error:

Error sending mail: mail [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set

I realize I need to change localhost to my isp's mail server, but even when I do this it doesn't work. Is it because my ISP requires an SSL connection?

Thank you,
 * It this case, you may to use $wgSMTP (and get Mail.php from PEAR). Also update your MediaWiki copy, 1.5.8 is really old. i Alex  20:33, 27 July 2009 (UTC)

Image transform functions consume all server memory
—207.188.29.244 23:23, 21 July 2009 (UTC)


 * MediaWiki version: Latest version recently ugraded ( 1.15 (Current latest download)


 * PHP version:  5.0
 * MySQL version: 4.0
 * URL: http://wiki.club8090.co.uk/index.php/Main_Page

Hi, we have a few problems with viewing Special pages, particularly Unused files, Uncategorised files etc. Also seems where images are thumbnailed in topics, rendering the full image presents a memory issue (get a blank page), even though the image maybe not particularly large. Here is a typical example: http://wiki.club8090.co.uk/index.php?title=Exhausts&action=edit

Here is a typical situation:

Select Special Pages Click unused file Process stalls Consult server logs...

PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 9920 bytes) in /home/club8090/wiki/includes/media/Bitmap.php on line 194, referer: http://wiki.club8090.co.uk/index.php/Special:SpecialPages

Those lines are the bottom 2 in this code fragment, which is where it is trying to 'transform' images (in this case a test showed it to be jpeg images, one being a simple B&W scan of a few profile lines (if that is relevant) Penultimate line is line 194 Thanks for any light anyone can shed on this

Additionally, I cannot find how to 'Protect' Special Pages from All users (without editing rights) They really don't need to consult them... but Special Pages don't seem to be offered under the normal Wiki Protect mechanism

Many thanks for any help...

—82.21.211.115 19:25, 27 July 2009 (UTC)

Clive Smith
 * The URL seems to work now, but 32 MB for memory_limit is a bit low for MediaWiki. i Alex  20:28, 27 July 2009 (UTC)