undefined function: session_id()

PaulC

Joined: 2002-09-23
Posts: 4
Posted: Mon, 2002-09-23 04:39

I'm new to Gallery, and have just installed v1.3.1 on my linux box at home (Mandrake 8, apache 1.3.6, php 4.2.1).

Installation went smoothly, I addressed the (minor) things the configuration lizard complained about, and got a clean bill of health. However, when I try to access the gallery I get:

Fatal error: Call to undefined function: session_id() in /folders/extranet/gallery/session.php on line 38

Can anyone offer an insight into this?

Assuming it's behaving the same way from the 'net, the URL is http://home.bod.org/gallery

Any help is much appreciated,

Paul

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Mon, 2002-09-23 07:37

That's an indicator that the PHP session subsystem is not configured properly. Try the "session diagnostic" linked from the config wizard and see if it fails there also.
Make sure that you haven't built PHP with sessions disabled.

Post a link to your PHP info -- that'll help us to get to the bottom of this.

 
PaulC

Joined: 2002-09-23
Posts: 4
Posted: Mon, 2002-09-23 14:10

This should work:

http://home.bod.org/gallery/phpinfo.html (a static snapshot)

Sure enough, looks like my 'stock' PHP config doesn't have the session stuff enabled.

I'm afraid I'm a PHP newbie, is the easiest way to enable this to recompile from source? I can do that, though I generally prefer RPM-based installations.

Paul

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Tue, 2002-09-24 02:24

I always build PHP from source, so I haven't encountered this problem. I'm on FreeBSD, so this is a normal course of action. Any linux folks want to jump in and point out a RPM distro that has sessions enabled properly?

 
PaulC

Joined: 2002-09-23
Posts: 4
Posted: Tue, 2002-09-24 07:14

I thought I'd try the simple solution, and upgrade to PHP 4.2.3 using RPMs. That does have the session stuff enabled. Everything went smoothly, and I did a fresh configuration of Gallery, for good measure.

Unfortunately, I'm not out of the woods yet. Going to the albums page after configuration gives me the error:

Warning: Cannot send session cache limiter - headers already sent (output started at /folders/extranet/gallery/albums.php:31) in /folders/extranet/gallery/session.php on line 51

followed by a very long pause, and if I'm lucky, sometimes the albums page with zero albums that I'm expecting.

Paul

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Tue, 2002-09-24 08:48
Quote:
Warning: Cannot send session cache limiter - headers already sent (output started at /folders/extranet/gallery/albums.php:31) in /folders/extranet/gallery/session.php on line 51

It's telling you that something on line 31 of albums.php is printing text out to the browser, and that is interfering with the sesssion code. Now, line 31 of albums.php in the code that we distribute doesn't print out anything. Have you modified the code at all? What's on line 31 of your copy?

 
PaulC

Joined: 2002-09-23
Posts: 4
Posted: Tue, 2002-09-24 17:04

I'd added some debug code, then deleted it again, but had left in a blank line before the <? requires($GALLERY_BASEDIR... line on line 30.

I copied a fresh, untouched copy of albums.php over the top of it, and that seems to have cleared up the message, so I must have disturbed something else without realizing. Oops...

Anyhow, with that error message out of the way, I've figured out what the real issue is...

I use two DSL lines at home, with a Nexland Pro800 Turbo router that aggregates them together (almost equivalent to 3Mbps down/1Mbps up for $100 a month :smile:. The problem is, if I use the public URL of my linux box (home.bod.org) on my local network, the network traffic gets thrown away, as the Pro800 Turbo won't 'loop back' outgoing packets addressed to the IP address on one of the LAN ports. So to see my local web server on my internal network, only its local name will work (home.intranet). That's what I've been using, but it seems that having the 'photoAlbumURL' and 'albumDirURL' be fully-qualified URLs for the public URL runs into this loopback issue. I changed them to the internal URL, and it works.

So I think I can work around this by some trickery on my local DNS server with private DNS records. I'd been putting it off because it's yet another thing I have to learn :smile:

But I'd also like to request if there's a way that those variables can be specified as relative to the domain of the incoming HTTP request, rather than fully-qualified (if that's not already the case? haven't tried it).

Thanks for your help,

Paul

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Tue, 2002-09-24 18:09

The URLs can't be specified as local, but you can dynamically rewrite the URL as necessary. I outline a solution for this here:

http://gallery.menalto.com/modules.php?op=modload&amp;name=phpBB_14&amp;file=index&amp;action=viewtopic&amp;topic=457&amp;1678