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

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)

Problem using the NoTitle Extension with version 1.15.1

 * MediaWiki version: 1.15.1
 * PHP version: 5.3.0
 * MySQL version: 5.0.45
 * URL: private

I get the following error spammed at the top of every request:

Notice: Use of undefined constant MAG_NOTITLE - assumed 'MAG_NOTITLE' in /usr/local/httpd-2.2.12/htdocs/mwiki/extensions/notitle.php on line 28 Notice: Undefined variable: action in /usr/local/httpd-2.2.12/htdocs/mwiki/extensions/notitle.php on line 36 Notice: Undefined variable: action in /usr/local/httpd-2.2.12/htdocs/mwiki/extensions/notitle.php on line 36

I've triple checked and the code in notitle.php as well as the require statement needed in LocalSettings.php.

Anyone have any ideas? Thanks, Rhugga

—Rhugga 19:02, 1 August 2009 (UTC)

Help: [RESOLVED]Global hooks array is not an array! Error.

 * MediaWiki version: 1.7.1
 * PHP version: 5
 * MySQL version: 5
 * URL: http://www.toonophilia.net/toonopedia

The following error I get when I view the page is:

Global hooks array is not an array!

Backtrace:


 * 1) 0 /mounted-storage/home20b/sub001/sc20370-KEAR/toonophilia.net/toonopedia/includes/MagicWord.php(102): wfRunHooks('MagicWordMagicW...', Array)
 * 2) 1 /mounted-storage/home20b/sub001/sc20370-KEAR/toonophilia.net/toonopedia/includes/Setup.php(60): require_once('/mounted-storag...')
 * 3) 2 /mounted-storage/home20b/sub001/sc20370-KEAR/toonophilia.net/toonopedia/index.php(80): require_once('/mounted-storag...')
 * 4) 3 /mounted-storage/home20b/sub001/sc20370-KEAR/toonophilia.net/gallerythumbnail.php(1) : eval'd code(22): include('/mounted-storag...')
 * 5) 4 /mounted-storage/home20b/sub001/sc20370-KEAR/toonophilia.net/gallerythumbnail.php(1) : eval'd code(35): doc_out
 * 6) 5 /mounted-storage/home20b/sub001/sc20370-KEAR/toonophilia.net/gallerythumbnail.php(1): eval
 * 7) 6 {main}

The mediawiki script was working fine until recently. I connected to the internet and checked my site and recieved this error. I have searched everywhere for information to how to fix this error but cannot find any information I can understand or follow.

I would like help on how to get my mediawiki working again. If it comes to reinstalling, that is no problem as my database is backed up. However I would like to avoid reinstalls to save time as I have alot of administrating to do. Could somebody help me please? Thanks.

—94.196.9.254 11:16, 5 August 2009 (UTC)

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)