MediaWiki and session_name()?

apps

#1

I updated a MediaWiki installation to the latest stable version (1.19.2) and changed the domain’s PHP to 5.3.x FastCGI.

Now when I load any page, I get the following error:

Fatal error: Call to undefined function session_name() in (my MW folder)/includes/Setup.php on line 456

When I switch it back to PHP 5.2.x, FastCGI, that error goes away.

Line 456 simply says:

session_name( $wgSessionName ? $wgSessionName : $wgCookiePrefix . ‘_session’ );

Any ideas what might be wrong?


#2

You need to have sessions enabled in php for MediaWiki to work, and basically that means it’s not.

Did you make a php.ini file for your account? I believe you can edit your phprc (or php.ini) to turn on sessions

PHP Info: http://wiki.dreamhost.com/PHP.ini#phprc

Sessions: http://support.qualityunit.com/021373-How-To-Enable-Session-Support-for-PHP


#3

Sessions are on by default; only reason they’d be off is if there’s something in your PHP 5.3 configuration that’s preventing the extension from loading. Remove any PHP 5.3 configuration files you’ve added and try again.


#4

That’s what’s really confusing to me – I never tinkered with the sessions; they worked fine under 5.2, so why would they suddenly turn of with the Dreamhost panel change to 5.3?

There is no php.ini (or .php folder in ~).

On the command line, php -m shows “session” and phpinfo(); on a webpage shows “’–enable-session=shared’” under “Configure Command”.

However, the 5.2 version of phpinfo() has an entire SECTION dedicated to session, where as the 5.3 does not… is there any way to manually enable it somehow if it got mysteriously disabled…?
[hr]
And Andrew, could it be similar to what you said in this thread:

Where sessions weren’t enabled for that particular build of PHP 5.3?

I believe I am on “ps23391”, if that matters…


#5

Aha — looks as though one of the configuration files for PHP needed to be regenerated on your server. I’ve done this now, so you should be good. Sorry about the hassle!


#6

Aha! Thank you!

I spent forever debugging it and couldn’t for the life of me figure out what I was doing wrong, and why no other Dreamhost customers seemed to have this issue. Shoud’ve just asked you all earlier :slight_smile:

Thank you again for the help.