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

Strange behaviour after install, PHP problem?

 * MediaWiki version: 1.13.2
 * PHP version: 5.2.6
 * MySQL version: 5.0.45
 * URL: http://www.mikakunii.net/mikawiki

A very strange behaviour of wiki after install: articles are not shown at all although content is present: try edit to see that its present, or follow http://www.mikakunii.net/MikaWiki that is working on the same database (that 2nd wiki was istalled after that problem did appear on the 1st).

During install process I had some warnings ( intall_log.txt for complete reference): I tried asking my hosting service assistance and they told me that the cause maybe was more due an error configuring mediawiki than a server problem. I installed same version on a localhost doing the same install procedure and everything has gone well so I suppose its a PHP error and not a configuration error, maybe am I wrong? I don't think its a mysql issue as the 2nd installation of mediawiki works good on the same database. And as the install procedure build everything was necessary I thought also its more concerning PHP than a installation error itself.

Notice warning during install procedure:

Warning: is_dir: open_basedir restriction in effect. File(/opt/pieroni/php5/session) is not within the allowed path(s):(/var/www/vhosts/mikakunii.net/httpdocs:/tmp) in /var/www/vhosts/mikakunii.net/httpdocs/mikawiki/config/index.php on line 438 Warning: Your session.save_path value (/opt/pieroni/php5/session) appears to be invalid or is not writable. PHP needs to be able to save data to this location for correct session operation.

Maybe this is the main problem or a sign of a lack of PHP config on server? Please help me, thank you. I tried to do my best... but can't solve this alone. --Federicodip 18:47, 15 December 2008 (UTC)

Parse error

 * MediaWiki version:
 * PHP version 	5.2.5
 * MySQL version4.1.22-standard
 * URL:

I am trying to move a wiki from one location to another. I keep getting this error: Parse error: syntax error, unexpected T_NEW in /home/XXXX/public_html/wiki/includes/GlobalFunctions.php on line 1494 What can i do? i imported the database, updated the localsettings and everything seem to be allright.

a fresh install of media wiki works fine. all of the files are identical.

when i change the localsettings to the fresh mediawiki install it works fine.

—89.139.135.106 18:10, 31 December 2008 (UTC)

Permission problem with Apache: cannot reproduce in Apache debug mode

 * MediaWiki version: 1.13.3
 * PHP version: 5.2.6-5
 * MySQL version: 5.0.67-2
 * URL:

I'm using Apache 2.2.10-2. If I run Apache as a service on my Linux box, I get PHP permission errors in the HTTPD logs:

PHP Warning: Unknown: failed to open stream: Permission denied in Unknoxn on line 0 PHP Fatal error: Unknown: failed opening required '/var/www/html/mediawiki/index.php' (include_path='.:/usr/share/pear:/usr/share/php') in Unknown on line 0

However if I start Apache in debug mode with

> /usr/sbin/httpd -X

Mediawiki works fine. The httpd process is running under the same UID (apache) both times. Any ideas? Thanks.

—69.12.144.158 05:57, 5 January 2009 (UTC)


 * Assuming you're running PHP as an Apache module, the Apache user needs to be able to read the entire /mediawiki directory. /var/www is usually owned by the Apache user anyway, but if not, make it readable to all:
 * If you're in a multi-user environment, then you should be a bit more cautious:
 * —Emufarmers(T 15:47, 5 January 2009 (UTC)
 * —Emufarmers(T 15:47, 5 January 2009 (UTC)
 * —Emufarmers(T 15:47, 5 January 2009 (UTC)

(RESOLVED) Parser Error

 * MediaWiki version: Latest
 * PHP version: 5.2.5
 * MySQL version: 5.0.51a-community
 * URL: wiki.gamesnation.co.cc

When i'm moving the LocalSettings.php or something it says me an error:

Fatal error: Class 'ParserOutput' not found in /home2/fenzon/public_html/wiki/includes/parser/Parser.php on line 178

What should i do now?

—94.67.155.172 17:33, 15 January 2009 (UTC)


 * I don't see any errors when I visit the site. —Emufarmers(T 04:28, 16 January 2009 (UTC)

Strange error after backuping

 * MediaWiki version: 1.13.3
 * PHP version: 5.2.6
 * MySQL version: 5.0.45
 * URL: http://web223.sydney.webhoster.ag/user/david_b/homepages/vwikika

Hey guys, I installed the backup-script of http://www.mediawiki.org/wiki/User:Flominator/Backup_MW and it works. Then I tried to exec it with a cronjob. I entered the command on my web-interface. Minutes later I want to log in to my Wiki as the error (see below) appeared. The cronjob hasn't been started yet! I absolutely don't know what to do. MediaWiki crashes in reason of copying files?!

Thank you for your help! David

THE ERROR:

Warning: require_once(/var/www/html/web223/html/user/david_b/homepages/vwikika/StartProfiler.php) [function.require-once]: failed to open stream: No such file or directory in /var/www/html/web223/html/user/david_b/homepages/vwikika/includes/WebStart.php on line 78

Fatal error: require_once [function.require]: Failed opening required '/var/www/html/web223/html/user/david_b/homepages/vwikika/StartProfiler.php' (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/html/web223/html/user/david_b/homepages/vwikika/includes/WebStart.php on line 78

//edit I upload the StartProfiler.php again and now I got the information: MediaWiki 1.13.2 - Please set up the wiki first.

—Trop 21:33, 15 January 2009 (UTC)


 * Re-upload all the wiki files. Rerun the installer or manually recreate LocalSettings.php if you destroyed your copy. —Emufarmers(T 04:28, 16 January 2009 (UTC)


 * I re-upload all files and it works. Thank you! But isn't this strange? I mean I didn't change any files and the wiki chrashed ^^

Maximum execution time during import

 * MediaWiki version: 1.13.3
 * PHP version: 5.2.8 with Suhosin-Patch 0.9.6.3 with eAccelerator v0.9.5.3
 * MySQL version: 5.0
 * URL:

I want to import one page from wikipedia.org to my wiki, so I exported page from wikipedia and got *.xml Then I exported this file to my wiki, and so apache began use 80% cpu and then stoped process with error:

[Tue Jan 27 15:15:53 2009] [error] [client my_ip] PHP Fatal error: Maximum execution time of 30 seconds exceeded in /var/www/mywiki.ru/htdocs/languages/Language.php on line 2482, referer: http://mywiki.ru/index.php/Special:Import

—89.19.34.75 15:54, 27 January 2009 (UTC)


 * Are you sure you only exported that one page? If so, temporarily increase max_execution_time in php.ini, or use another import method. —Emufarmers(T 22:17, 27 January 2009 (UTC)

How to Avoid 'Login Required' Error page.
I've setup a private internal mediawiki with users unable to create accounts (admin only). I can't figure out how to avoid (or redirect) the 'Login Required' error page and have the Login page (Special:Userlogin) be the first page up (and then modify its text to welcome users, etc).
 * MediaWiki version: 1.13.3
 * PHP version: 5.0.67
 * MySQL version: 5.0.16
 * URL: gefsr.com 

The only suggestion I've found is to use this in LocalSettings.php : $wgRedirectMustLogin = true; $wgRedirectLoggedIn = true; neither of which work (though I did manage to redirect the useless 'you are now logged in' page to the main page).

Or, perhaps there's a way to include login within the MainPage? (and then whitelist the main page)

I'm a beginner, thanking you in advance!

Graz

—Graz 19:10, 7 February 2009 (UTC)

php global settings enabled error when installing mediawiki

 * MediaWiki version: latest version
 * PHP version: latest version
 * MySQL version: latest version

Hi, ive just installed wikimedia on my website. everything works. But when i was installing, i got the "php global settings are enabled, please disable this option (if you can)error"

I was wondering what i need to do to diasble this option.

—NickGeller 21:00, 7 February 2009 (UTC)

500 Internal Server Error (only on one single page)

 * MediaWiki version: 1.13.3
 * PHP version: 5.2.6
 * MySQL version: 5.0.45
 * URL:

Hi, I just found some Threads with the similar topic but I didn't find a solution yet.

The following errors occurs only on one (didn't find another ^^) page:

'' Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, root@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. ''

I don't have access to my php.ini. Tried to active logs by using the LocalSettings.php but it didn't works.

Any idea :/ ?

David

—Trop 09:36, 11 February 2009 (UTC)

Problem solved! The reason was a category which was subcategory of itself. Each page which was categorized with this category responsed with an error. Also the category page itself.

I deleted the relevant row in the SQL "Category links" table and now it works again...

--Trop 19:15, 12 February 2009 (UTC)

IE 7 has trouble loading pages

 * MediaWiki version: 1.13
 * PHP version: 5
 * MySQL version: 3.23
 * URL:

We have been using MediaWiki for about a month with no problems. Over the last two days something has changed. Even though we have not changed any of our settings. Primarly IE7 has problems loading pages about every 10th time. Error log shows a [20-Feb-2009 13:00:44] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 223430368 bytes) in Unknown on line 0 everytime there is an error on the page. I should note that if you refresh or hit back enough times the page will eventually load. And it is not a specific page.

—24.213.187.250 21:29, 20 February 2009 (UTC)

GlobalFunctions.php error on MW 1.14.0
I have a problem with MediaWiki 1.14.0. Everytime I go to the Special:Preferences... I'll get this error message on top of the page: Warning: urlencode expects parameter 1 to be string, object given in /home/www/myserver/wiki/includes/GlobalFunctions.php on line 1141. How do I fix this issue? Specs: MediaWiki 1.14.0, PHP 5.0.5 (cgi), MySQL 4.xx and no extensions. Fresh install (not update). --Rtmm 18:11, 22 February 2009 (UTC)

I am seeing the same problem. Mine was an upgrade from MW 1.5.5 to MW 1.14.0. PHP 5.1.4, MySQL 4.1. The page seems to work properly, but it has the warning message displayed at the top. DM


 * A var_dump shows that an Title object is given to urlencode at line 1141.
 * A temporary patch can be


 * inserted before line 1140
 * FrViPofm 21:58, 2 March 2009 (UTC)

Another possible workaround is to disable warnings by adding this to the top of index.php: error_reporting(0);

Mediawiki 1.14.0 Call to undefined method Interwiki::fetch

 * MediaWiki version: 1.14.0
 * PHP version: 5.1.6
 * MySQL version: 5.0.22
 * URL: private mediawiki

After upgrading from 1.13.4 to 1.14.0, I am facing PHP error on Title.php (my Main Page contains interwiki links): PHP Fatal error: Call to undefined method Interwiki::fetch in /bases/html/mediawiki-1.14.0/includes/Title.php on line 678

Could you please tell me if it is a Mediawiki bug or a problem of installation/configuration somewhere ? (I only untar 1.14.0 to new dir then replace images, extension, LocalSettings.php and AdminSettings.php with those set (and working) for previous 1.13.4)

—64.208.49.22 13:29, 24 February 2009 (UTC)


 * probably due to Extension:SpecialInterwiki
 * * comment the line require_once( "$IP/extensions/SpecialInterwiki.php" ); from LocalSettings.php
 * * or upgrade tot the latest version of the extension.
 * success - Arent 12:23, 30 March 2009 (UTC)

Fatal error: Class 'ArrayIterator' not found in /usr/local/www/mediawiki/includes/StringUtils.php on line 179

 * MediaWiki version: 1.14
 * PHP version: php5-5.2.8
 * MySQL version: mysql-server-5.1.30
 * URL: Internal

AFter config and moving file LocalSettings.php to root. I point my browser to the wiki page and get:

Fatal error: Class 'ArrayIterator' not found in /usr/local/www/mediawiki/includes/StringUtils.php on line 179

Any ideas? THanks all

—65.242.79.69 21:38, 26 February 2009 (UTC)
 * ArrayIterator is part of the Standard PHP Library, so you need to have PHP compiled without --disable-spl. i Alex  07:41, 9 March 2009 (UTC)

Class 'ArrayIterator' not found

 * MediaWiki version: 1.14
 * PHP version: 5.2.8
 * MySQL version: 4.1.22
 * URL: private

I get this error since update: Fatal error: Class 'ArrayIterator' not found in wiki/includes/StringUtils.php on line 179

Seems to be the same problem -> http://www.mediawiki.org/wiki/Project:Support_desk#Fatal_error:_Class_.27ArrayIterator.27_not_found_in_.2Fusr.2Flocal.2Fwww.2Fmediawiki.2Fincludes.2FStringUtils.php_on_line_179

Also I get some warnings. Maybe they are related/useful.

Warning: debug_backtrace has been disabled for security reasons in wiki/includes/GlobalFunctions.php on line 873

Warning: array_slice expects parameter 1 to be array, null given in wiki/includes/GlobalFunctions.php on line 873

Warning: ini_set has been disabled for security reasons in wiki/includes/db/Database.php on line 433

Warning: ini_set has been disabled for security reasons in wiki/includes/db/Database.php on line 440

—89.27.231.126 18:53, 1 March 2009 (UTC)

Update

In my whole life I only wrote a few lines of php code. So I don't know much about php code but anyway I looked into the code:

First I read on the internet, that the ArrayIterator constructor is not public and you have to use getIterator on an ArrayObject. But if it is still true, I'm confused most ppl have no problems.

But there is more. “return new ArrayIterator( explode( $separator, $subject ) )” looks like endless recursion.

--89.27.231.126 19:31, 1 March 2009 (UTC)

dumpBackup.php error - tries to use root even with LocalSettings.php

 * MediaWiki version: 1.14
 * PHP version: 5.1.6
 * MySQL version: 5.0.45
 * URL: Intranet only

I have a AdminSettings.php in my maintenance folder (created from the template in the wiki directory) that contains database connection user and password. The scripts in the Maintenance folder that I have tried run successfully, including scripts that seem to be getting information from the database, however dumpBackup.php will not run successfully.

When I run  it says. It is not getting the db connection information from AdminSettings.php. AdminSettings.php is owned by apache:apache, and I have tried setting to 660, 770, 666, 777, with no change. It is now set back to 600, and other scripts seem to be still working fine.

I have got around the issue by placing $wgDBadminuser and $wgDBadminpassword lines (copied exactly from AdminSettings.php) directly into a copy of dumpBackup.php. It then works fine.

Any ideas why it won't work as it's intended to?

—220.245.120.79 00:08, 9 March 2009 (UTC)


 * Configure AdminSettings.php. —Emufarmers(T 00:13, 9 March 2009 (UTC)

My Apologies - my original post had a typo. Corrected in post. That's what happens when you try and log it the next morning not in front of it LOL.

AdminSettings.php IS configured with $wgDBadminuser and $wgDBadminpassword, and other scripts work fine. dumpBackup.php continues to try and use root, disregarding the connection strings in AdminSettings.php.

—220.244.29.69 06:41, 9 March 2009 (UTC)

Fatal error: Class 'ArrayIterator' not found in /usr/local/www/apache22/data/wiki/includes/StringUtils.php on line 179
I got this error on my FreeBSD 7.1 system, directly after moving the LocalSettings.php file. The solution provided in this section did not solve the problem in my case.
 * MediaWiki version: 1.14.0
 * PHP version: 5.2.8
 * MySQL version: 5.0.67
 * URL: internal link

I edited the StringUtils.php page from line 179 to skip using the ArrayIterator. I edited the 'else' part to test.

Note that my wiki shows at this point. Before I only got a browser http 500 error message with the fatal error in the (apache22) web server error log.

I noticed also the class for the ArrayIterator is not present in the file like the class for ExplodeIterator.

Now I can see the main page, but it only shows the main heading and it looks I can edit but not save the edited pages (or the fonts are white?) In the error log I notice more errors.

Hope part of this info helps finding out the actual problem here.

—82.148.222.98 15:25, 17 March 2009 (UTC)
 * See above. i Alex  21:59, 20 March 2009 (UTC)


 * MediaWiki version: 1.14
 * PHP version: 5
 * MySQL version:
 * URL: http://dfwebdev:9042/index.php?title=Main_Page

I am getting HTTP 500 internal server error

Blank login page and php error cannot redeclare class skintemplate

 * MediaWiki version: 1.14.0
 * PHP version: 5.2.6 (apache2handler)
 * MySQL version: 5.0.77
 * URL: Internal Only

I'm outside of my scope of experience here so please phrase your answers without assuming I know lots of things (I haven't even really begun to understand the levels of dependencies).

I have successfully installed Mediawiki on a local box and had successfully created and edited some pages. I had also successfully uploaded images to some of those pages.

All of a sudden whenever I try to upload an images I get told I have to login, however when I go to the login/create account page it's just blank.

I checked the httpd logs and found the following message......

[error] [client 192.168.1.12] PHP Fatal error: Cannot redeclare class SkinTemplate in /var/www/html/wiki/includes/SkinTemplate.php on line 997, referer: http://192.168.1.240/wiki/index.php?title=Special:Upload&wpDestFile=someimage.jpg

I've looked at SkinTemplate.php and line 997 doesn't have a redeclare command (I'm not really sure what this is doing as this is well outside my experience zone)...

The code block near to line 997 is......

However it's the very last } that's actually on line 997, I'm assuming that the last } causes the commands to be executed and that's why the error is flagging up there.

If anyone could give me some pointers I'd be very grateful as I'm stuck here and because I don't understand the dependencies I could spend hours trying to solve what may be a trivial fault.

Thanks in advance.

—79.73.111.66 04:24, 5 April 2009 (UTC)

Fatal error when trying to create a modified monobook theme

 * MediaWiki version: 1.14.0
 * PHP version: 5.2.6
 * MySQL version: 4.1.25
 * URL: removed for now.

What I am trying to accomplish is to create a slightly modified version of the monobook theme. Steps: 1) I made a copy of the Monobook.php, MonoBook.deps.php, and monobook folder. 2) Replaced all instances of 'Monobook' or 'monobook' (aware of case-sensitivity) with 'Greencurrent' or 'greencurrent' within the copied files and renamed the files themselves.

The result is a fatal error:

Fatal error: Class 'GreencurrentSkinTemplate' not found in [serverpath]/html/wiki/includes/SkinTemplate.php on line 128

While I would love to resolve this, I am equally keen to know how I would go about debugging this myself!

—Maltebeckmann 13:41, 7 April 2009 (UTC)

$wgForeignFileRepos php errors

 * MediaWiki version: 1.14
 * PHP version: 5+
 * MySQL version: 5+
 * URL: http://wikademia.org/File:Animation_exmaple-animatic.jpg

These image pages give errors at the top of the page:
 * http://wikademia.org/File:Animation_exmaple-animatic.jpg
 * http://wikademia.org/File:Chicago_Downtown_Aerial_View.jpg
 * http://selfindulgence.org/File:Vallée_du_Marcadau_5.JPG
 * http://selfindulgence.org/File:White_headed_bird_in_zoo_heidelberg.jpg

These image pages do not seem to give errors at the top of the page:
 * http://wikademia.org/File:Nasa.florida.750pix.jpg
 * http://wikademia.org/File:Animation_example-inked_drawing.png
 * http://wikademia.org/File:Shadow_Hand_Bulb_large.jpg

I think I'm using the normal $wgForeignFileRepos for Commons defaults... I'm not sure why this is happening. If I could have all the pages display cleanly, it would be super great; and if anyone can help me fix it, I will be very very grateful. Thank you!

—Wikademia 04:52, 13 April 2009 (UTC)

Call to undefined method Category::getText in CategoryPage.php

 * MediaWiki version:1.14
 * PHP version: 5.2.8(apache2handler)
 * MySQL version: 5.1.30
 * URL: intranet!

Hi, following happened: I create Page "D", add(with category-syntax)to Category "A", works fine! But when adding Page "D" to new Category "B" and add this Category also to Category "A" I get this error: Fatal error: Call to undefined method Category::getText in C:\xampp\htdocs\wiki\includes\CategoryPage.php on line 151

147	function addSubcategory( $title, $sortkey, $pageLength ) { 148		global $wgContLang; 149		// Subcategory; strip the 'Category' namespace from the link text. 150		$this->children[] = $this->getSkin->makeKnownLinkObj( 151			$title, $wgContLang->convertHtml( $title->getText ) );

please help me!!! Thanks in advance!!!

—Freezone 08:42, 20 April 2009 (UTC)

I got it! It's not allowed, to link Cat A and B on Page C and Cat A on Cat C. I know that it's written in WIki Rules, to be not recommended, but now I'm smarter: This is forbidden!!!

—Freezone 08:42, 23 April 2009 (UTC)

Redirect to an older version despite a newer one ist already reviewed
An an unlogged user of de.wikipedia.org, if I call honsik, I will be redirected to Gerd Honsik, and there appeares an older version as the last reviewed ("gesichtet"). But there exists an other reviewed version just some 4 versions later than the first mentioned: dies later reviewed version appears in the history of versions as reviewed by the user benutzer:Eintragung ins Nichts. If I go to honsik as logged in user Benutzer:Machtjan X, the link brings the last and recent version. Only if I log out and quit the browser and start it newly again, the link brings the older version again. - Thank you for excusing my poor English - now my question: Indicates the mentioned behavior of the wiki a bug? Here the diff in question:
 * MediaWiki version: 1.15alpha (r48811)
 * PHP version: 5.2.4-2ubuntu5wm1 (apache2handler)
 * MySQL version: 5.1.33-log
 * URL: http://de.wikipedia.org

—Machtjan X 13:54, 27 April 2009 (UTC)

PHP Fatal Error
Suddenly getting the following on all pages
 * MediaWiki version: Can not connect to tell!
 * PHP version: 2.2.11 (Unix)
 * MySQL version: 5.0.77-community
 * URL: www.taxationsupport.net/wiki/index.php

PHP Fatal error: Call to a member function lcfirst on a non-object in /home/taxation/public_html/wiki/includes/GlobalFunctions.php on line 490

No new extensions have been installed for some time. GlobalFunctions.php has not been updated.

Any ideas please?

—213.48.94.65 10:28, 28 April 2009 (UTC)

Can't create Directory (mkdir - php-func) under XAMPP Windows XP

 * MediaWiki version: 1.14.0
 * PHP version: 5.1.6
 * MySQL version: 5.0.24a-community-nt
 * URL:

Hi, i get this error, if i try to upload an image into my wiki: Warning: mkdir [function.mkdir]: No such file or directory in D:\Programme\xampp\htdocs\mediawiki\includes\GlobalFunctions.php on line 1943 ... Interner Fehler (Internal Error)

Das Verzeichnis „public/7/7a“ konnte nicht angelegt werden.

—217.94.53.101 13:04, 5 May 2009 (UTC)


 * Try the fix listed on bug 18656. —Emufarmers(T 18:51, 5 May 2009 (UTC)


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

Hello Mediawiki Team, Great software, however I get these errors when i try to install it on my website:



Warning: exec has been disabled for security reasons in /home/studitco/public_html/wiki/config/index.php on line 2005

Warning: array_map [function.array-map]: Argument #2 should be an array in /home/studitco/public_html/wiki/config/index.php on line 2010

Warning: Invalid argument supplied for foreach in /home/studitco/public_html/wiki/config/index.php on line 2013

It tells me also that the database name is invalid.

Help is appreciated. Thanks

—78.86.229.50 18:11, 8 May 2009 (UTC)

PHP Warning

 * MediaWiki version: 1.14
 * PHP version: 5.2
 * MySQL version: 5.02 readline 5.2
 * URL: intern highschool project on server that is only available via SSH, sry cannnot give you log in data :/

Warning: dba_open(/var/lib/mediawiki/images/tmp/mw-cache-wikidb.db,cl) [function.dba-open]: No such handler: db3 in /usr/share/mediawiki/includes/BagOStuff.php on line 715

—84.46.46.128 01:32, 9 May 2009 (UTC)