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)

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)


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

Config runs fine but one I point browser to serve Wiki I get the following error on the browser.

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

—65.242.79.69 19:34, 26 February 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)

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)