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 Showing template content in skin file

 * MediaWiki version: 1.14.0 (r9)
 * PHP version: 5.2.6 (cgi-fcgi)
 * MySQL version:  	5.0.67-log
 * URL: http://beta.shapingsf-wiki.org/index.php?title=Main_Page

Hi, I am new to MediaWiki. I want to split the home page into multiple templates so that it can be easily edited. Right now the contents are hard coded into the skin_name.php file. I tried the following code:

$id = Title::newFromText("Template:HomepageImages")->getArticleId; //print_r($id); $myArticle = Article::newFromId($id); //Make an article object from that id //print_r($myArticle); echo $myArticle->getContent;

I get the content of the template, however, the "special tags" are not converted. It shows (ignore the _ before closing ]) instead of the actual image. How can I get template content to display? Thanks.

—67.170.248.239 06:24, 7 August 2009 (UTC)
 * You need to pass it through $wgOut->parse, using something like:


 * i Alex  09:32, 7 August 2009 (UTC)

- It worked perfectly. Thank you so much.

failed to open stream: no such file or directory in /home/pedia/public_html/includes/autoloader.php on line 582

 * MediaWiki version: 1.15.1
 * PHP version: PHP 5.2.8
 * MySQL version: Server version: 5.0.81-community
 * URL: http://www.gamblingpedia.net

warning: require(/home/pedia/public_html/includes/templates/userlogin.php) [function.require]: failed to open stream: no such file or directory in /home/pedia/public_html/includes/autoloader.php on line 582


 * 1) PHP 5.2.8 installed
 * 2) Found database drivers for: MySQL SQLite
 * 3) PHP server API is apache2handler; ok, using pretty URLs (index.php/Page_Title)
 * 4) Have XML / Latin1-UTF-8 conversion support.
 * 5) Warning: A value for session.save_path has not been set in PHP.ini. If the default value causes problems with saving session data, set it to a valid path which is read/write/execute for the user your web server is running under.
 * 6) PHP's memory_limit is 200M.
 * 7) Couldn't find Turck MMCache, eAccelerator, APC or XCache; cannot use these for object caching.
 * 8) GNU diff3 not found.
 * 9) Found GD graphics library built-in, image thumbnailing will be enabled if you enable uploads.
 * 10) Installation directory: /home/pedia/public_html
 * 11) Script URI path:
 * 12) Installing MediaWiki with php file extensions

---

HomePage is working, but some other site sections returning with an error, for example login page.

Please help me to fix it, thanks.

—GamblingPedia 17:26, 12 August 2009 (UTC)
 * Are you sure that the file /home/pedia/public_html/includes/templates/userlogin.php exists? If this is not the case, then get it from here. i Alex  10:02, 17 August 2009 (UTC)

Hello iAlex. thank you for trying to help me. All files exist, the problem is (i think) with AutoLoeader.php as you can see, some other sections of the site have the same issue.

Parse error: syntax error, unexpected T_NAMESPACE
For testing an upgrade of MediaWiki software I downloaded and installed XAMPP on a windows XP system. I copied the WikiMedia dir from our production server to my XAMPP htdocs and also copied the database. I adjusted the LocalSettings.php to connect to the new database.
 * MediaWiki version: 1.9.3
 * PHP version: 5.3.0
 * MySQL version: 5.1.37
 * URL: localhost

When I go to the wiki page (https://localhost/wiki/) I get an error: Parse error: syntax error, unexpected T_NAMESPACE, expecting T_STRING in C:\xampp\htdocs\wiki\includes\Namespace.php on line 46

How can I fix this?

—LegeDoos 14:00, 21 August 2009 (UTC)


 * You have two possible options: Either downgrade PHP or upgrade MediaWiki. It's caused by the new PHP 5.3's namespaces funcionality. --Matěj Grabovský 14:06, 21 August 2009 (UTC)


 * Thanks for the info. I had this exact same problem ("Parse error: syntax error, unexpected T_NAMESPACE, expecting T_STRING in /Users/mediawiki/Sites/mediawiki/includes/Namespace.php on line 46") when I upgraded the machine running my MediaWiki installation from Mac OS X 10.5 Leopard to Mac OS X 10.6 Snow Leopard, and am placing this message here in hopes that others with the same problem will more easily be able to google the solution. -Isra1337@wikipedia 01:43, 3 September 2009 (UTC)

Hooks not working for PHP 5.3.0

 * MediaWiki version: 1.15.0
 * PHP version: 5.3.0 (isapi)
 * MySQL version: 5.0.51a-community-nt
 * URL: http://www.yeshiva.org.il/wiki

My host upgraded to PHP 5.3.0 and I had to disable about half of my extensions since they were returning internal errors. I realized they were all hooks. I get this error message (example from Extension:ConfirmEdit):

Detected bug in an extension! Hook SimpleCaptcha::confirmEdit failed to return a value; should return true to continue hook processing or false to abort. Backtrace: #0 D:\sites\yeshiva.org.il\inetpub\wwwroot\wiki\includes\EditPage.php(791): wfRunHooks('EditFilter', Array) #1 D:\sites\yeshiva.org.il\inetpub\wwwroot\wiki\includes\EditPage.php(2483): EditPage->internalAttemptSave(false, false) #2 D:\sites\yeshiva.org.il\inetpub\wwwroot\wiki\includes\EditPage.php(449): EditPage->attemptSave #3 D:\sites\yeshiva.org.il\inetpub\wwwroot\wiki\includes\EditPage.php(340): EditPage->edit #4 D:\sites\yeshiva.org.il\inetpub\wwwroot\wiki\includes\Wiki.php(510): EditPage->submit #5 D:\sites\yeshiva.org.il\inetpub\wwwroot\wiki\includes\Wiki.php(63): MediaWiki->performAction(Object(OutputPage), Object(Article), Object(Title), Object(User), Object(WebRequest)) #6 D:\sites\yeshiva.org.il\inetpub\wwwroot\wiki\index.php(116): MediaWiki->initialize(Object(Title), Object(Article), Object(OutputPage), Object(User), Object(WebRequest))
 * 1) 7 {main}

This is driving me crazy. Any help appreciated.

—Joe :) talk 12:15, 25 August 2009 (UTC)
 * This happens when the callback expects an argument to be passed by reference but this argument isn't passed by reference when calling wfRunHooks. These extensions are being fixed (ConfirmEdit should already be fixed), so try to download the latest for the extensions causing these errors and see if it's fixed. i Alex  08:13, 13 September 2009 (UTC)

Linker.php xml error

 * MediaWiki version: 1.51.1
 * PHP version: 5.2
 * MySQL version: 5.0.51-community
 * URL: http://preim.hostzi.com/mediawiki/index.php/Main_Page

Just after installation i cannot access the wiki because i get this error.

Fatal error: Class 'Xml' not found in /home/a8814660/public_html/mediawiki/includes/Linker.php on line 1042

That line contains: $attribsText .= Xml::expandAttributes( $attribs );

—122.57.201.107 22:26, 12 September 2009 (UTC)

Warning: mkdir [function.mkdir]: Permission denied
Sorry, I already mentioned my problem at MediaWiki Users, but I'm really going nuts here. I checked like every mkdir permission problem known to Google and I just don't know what to do anymore.

Background
I just moved my wiki family (5 installations: 4 language versions (MediaWiki 1.14) and one pool wiki (MediaWiki 1.13) for files) to a new server. On the old server everything worked fine.

On the old server I exported the MySQL databases via phpMyAdmin (with complete inserts).

I downloaded all files from the old wiki installations via ftp and uploaded everything to the new server and imported the databases via

Environment
Each wiki has a subdomain like wikipedia.org does (I'm using the same IP for each subdomain and  in the httpd.conf)
 * OpenBSD 4.5
 * Apache 1.3
 * PHP 5.2.8 (with enabled GD support, safe_mode	is off)
 * MySQL 5.0.77

Permissions

 * Every wiki directory including files is owned by the Apache user and group (www:www)
 * The images directory (including subdirectories) of the pool wiki is 777, the files are 644

Configuration
The LocalSettings.php of the pool wiki looks like this:

The LocalSettings.php of each language version looks like this:

Pool wiki

 * If I go to Special:UncategorizedFiles every thumbnail shows up 95 pixels width (95px-file.jpg)
 * If I resize an image to 123px, it creates the 123px-file.jpg so everything works fine here

Language versions
Warning: mkdir [function.mkdir]: Permission denied in /path/to/wiki/includes/GlobalFunctions.php on line 2012
 * If I load an article with an image thumb that has not been accessed before on the pool wiki, I get a blue link showing File:name.jpg
 * If the file has been loaded on the pool wiki before, I can see the image in thumbnail size, but it's actually the original size (just resized via HTML) and I get the following error:
 * If I press reload the error is gone (the thumbnail is still not really resized, just via HTML).
 * If I load the same site in a different browser, the error is back again.

I upgraded every wiki to 1.15.1, so there isn't even a difference between the wikis like it was before. Still no success.

Cheers, --Till Kraemer 09:35, 26 September 2009 (UTC)