forum.coppermine-gallery.net
Support => Older/other versions => cpg1.2 Standalone Support => Topic started by: Tallman027 on November 07, 2003, 06:29:03 pm
-
Hi all,
First of all the best gallery ever !!!
However theres one little thing I'm having trouble with.......
On every page I get the following errors, even though the gallery seems to work perfectly............any ideas ?
Warning: Undefined index: SCRIPT_NAME in /www.shorehambysea.com/coppermine/include/init.inc.php on line 91
Warning: Undefined index: REMOTE_ADDR in /www.shorehambysea.com/coppermine/include/init.inc.php on line 98
If anyone would like a closer look please go to
http://www.shorehambysea.com/coppermine and let me know what you think...........
Many thanks,
Tallman027
-
seems like the version of php running on your server doesn't support the env vars needed. Edit init.inc.php and replace $SCRIPT_NAME and $REMOTE_ADDR with the env vars that are supported on your server (probably $_SERVER["SCRIPT_NAME"] and $_SERVER["REMOTE_ADDR"]) - see your phpinfo() to check what server vars are supported.
GauGau
-
Many thanks for the reply.
I did as you advised and checked my phpinfo(). I found the following:
_ENV["SCRIPT_NAME"] = /fcgi-bin/php (not inc "=")
_ENV["REMOTE_ADDR"] = 81.128.16.116 (not inc "=")
So it looks as if its supported. I'm running PHP 4.1.2 by the way.
Any further ideas or advise on exactly how I change the inti.inc.php - I'm kind of a newbie at PhP so please be gentle with me !!!
Many thanks
Tallman027
-
http://coppermine.sourceforge.net/faq.php?q=ErrorUndefinedIndex#ErrorUndefinedIndex
GauGau
-
Gaugau,
Many thanks that fixed the SCRIPT_NAME issue however I still have the REMOTE_ADDR problem at the top of the page.
Sorry to bother you yet again, however if you have any further excellent advise, it would be much appreciated.
Cheers !
Tallman027
-
try replacing
$raw_ip = stripslashes($HTTP_SERVER_VARS['REMOTE_ADDR']);
with$raw_ip = stripslashes($_SERVER["REMOTE_ADDR"]);
or$raw_ip = stripslashes($_ENV["REMOTE_ADDR"]);
If this doesn't work for you, just comment line 98 out (you'll only lose the banning feature):// $raw_ip = stripslashes($HTTP_SERVER_VARS['REMOTE_ADDR']);
GauGau