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)


 * 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,

—207.188.29.244 23:23, 21 July 2009 (UTC)