forum.coppermine-gallery.net

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Installation & Setup => Topic started by: dRfruitLOOP on June 10, 2004, 11:22:46 pm

Title: [Solved]: Undefined Index: SCRIPT_NAME, REMOTE_ADDR
Post by: dRfruitLOOP on June 10, 2004, 11:22:46 pm
At the top of all my pages it says this...


Warning: Undefined index: SCRIPT_NAME in /<my site address>/gallery/include/init.inc.php on line 97

Warning: Undefined index: REMOTE_ADDR in /<my site address>/gallery/include/init.inc.php on line 104

Any ideas why? And how to fix that?

The other error is that every time I try to upload a photo, it says "Impossible to move" . What's the problem there?

Thanks for any help
Title: Re: Just installed, getting errors
Post by: Joachim Müller on June 10, 2004, 11:26:59 pm
your server seems to be set up improperly. Try silly_safe_mode (refer to documentation (http://coppermine.sourceforge.net/manual.php#safe)).

GauGau
Title: Re: Just installed, getting errors
Post by: dRfruitLOOP on June 11, 2004, 12:55:21 am
Thanks very much for the tip. Unfortunatly, adding that line like it said to do did nothing. Any other thoughts?
Title: Re: Just installed, getting errors
Post by: Joachim Müller on June 11, 2004, 01:15:16 am
As I said: your server is not set up properly. Check what version of PHP you're running (use the phpinfo link from the admin tool). Check if you have a server var named SCRIPT_NAME and/or REMOTE_ADDR.

GauGau
Title: Re: Just installed, getting errors
Post by: dRfruitLOOP on June 11, 2004, 01:54:25 am
It would appear that I have both of those.
Title: Re: Just installed, getting errors
Post by: hyperion on June 11, 2004, 02:12:40 am
Provide a link, please.
Title: Re: Undefined Index: SCRIPT_NAME, REMOTE_ADDR
Post by: dRfruitLOOP on June 11, 2004, 02:14:11 am
http://www.cebus-apella.com/gallery/
Title: Re: Undefined Index: SCRIPT_NAME, REMOTE_ADDR
Post by: hyperion on June 11, 2004, 02:18:45 am
Activate debug mode.
Title: Re: Undefined Index: SCRIPT_NAME, REMOTE_ADDR
Post by: dRfruitLOOP on June 11, 2004, 02:28:49 am
Done
Title: Re: Undefined Index: SCRIPT_NAME, REMOTE_ADDR
Post by: hyperion on June 11, 2004, 02:33:38 am
Post lines 80 through 110 of your init.inc.php file.
Title: Re: Undefined Index: SCRIPT_NAME, REMOTE_ADDR
Post by: dRfruitLOOP on June 11, 2004, 02:53:46 am
}

    if (is_array($HTTP_GET_VARS)) {
        foreach ($HTTP_GET_VARS as $key => $value) {
            $HTTP_GET_VARS[$key] = strtr($value, $HTML_SUBST);
            if (isset($$key)) unset($$key);
        }
    }

    if (is_array($HTTP_COOKIE_VARS)) {
        foreach ($HTTP_COOKIE_VARS as $key => $value) {
            if (isset($$key)) unset($$key);
        }
    }
}
// Initialise the $CONFIG array and some other variables
$CONFIG = array();
$PHP_SELF = isset($HTTP_SERVER_VARS['REDIRECT_URL']) ? $HTTP_SERVER_VARS['REDIRECT_URL'] : $HTTP_SERVER_VARS['SCRIPT_NAME'];
$REFERER = urlencode($PHP_SELF . (isset($HTTP_SERVER_VARS['QUERY_STRING']) && $HTTP_SERVER_VARS['QUERY_STRING'] ? '?' . $HTTP_SERVER_VARS['QUERY_STRING'] : ''));
$ALBUM_SET = '';
$FORBIDDEN_SET = '';
$CURRENT_CAT_NAME = '';
$CAT_LIST = '';
// Record User's IP address
$raw_ip = stripslashes($HTTP_SERVER_VARS['REMOTE_ADDR']);

if (isset($HTTP_SERVER_VARS['HTTP_CLIENT_IP'])) {
    $hdr_ip = stripslashes($HTTP_SERVER_VARS['HTTP_CLIENT_IP']);
} else {
    if (isset($HTTP_SERVER_VARS['HTTP_X_FORWARDED_FOR'])) {
        $hdr_ip = stripslashes($HTTP_SERVER_VARS['HTTP_X_FORWARDED_FOR']);
Title: Re: Undefined Index: SCRIPT_NAME, REMOTE_ADDR
Post by: hyperion on June 11, 2004, 03:18:53 am
Post the ID line from the beginning of the file. 

It should look something like this:

Code: [Select]
$Id: init.inc.php,v 1.33 2004/06/04 17:16:34 datajack Exp $
Title: Re: Undefined Index: SCRIPT_NAME, REMOTE_ADDR
Post by: dRfruitLOOP on June 11, 2004, 03:21:28 am
Code: [Select]
// $Id: init.inc.php,v 1.27 2004/03/31 04:55:05 hyperion01 Exp $
Title: Re: Undefined Index: SCRIPT_NAME, REMOTE_ADDR
Post by: hyperion on June 11, 2004, 03:24:23 am
Which package did you download?
Title: Re: Undefined Index: SCRIPT_NAME, REMOTE_ADDR
Post by: dRfruitLOOP on June 11, 2004, 03:33:14 am
cpg1.3.0beta4
Title: Re: Undefined Index: SCRIPT_NAME, REMOTE_ADDR
Post by: hyperion on June 11, 2004, 03:47:08 am
You should be using 1.3.0 (stable).  You may rip out your current install by deleting the files and database tables, and then you would install the stable package.  Alternatively, you may overwrite the files with the stable package files, but you must run the update.php file to execute the database changes. Please post again on this matter after you have done this.
Title: Re: Undefined Index: SCRIPT_NAME, REMOTE_ADDR
Post by: dRfruitLOOP on June 11, 2004, 04:50:32 am
Alright, will do. Thanks for the help so far.  ;D
Title: Re: Undefined Index: SCRIPT_NAME, REMOTE_ADDR
Post by: dRfruitLOOP on June 11, 2004, 05:08:07 am
I can now upload pictures but it still displays this at the top....


Warning: Undefined index: SCRIPT_NAME in /www.cebus-apella.com/gallery/include/init.inc.php on line 170

Warning: Undefined index: REMOTE_ADDR in /www.cebus-apella.com/gallery/include/init.inc.php on line 177
Title: Re: Undefined Index: SCRIPT_NAME, REMOTE_ADDR
Post by: omniscientdeveloper on June 11, 2004, 05:15:47 am
Try changing SCRIPT_NAME to URL or PATH_INFO
Try changing REMOTE_ADDR to REMOTE_HOST

Let us know if one of those work. What type of server are you on?

-omni
Title: Re: Undefined Index: SCRIPT_NAME, REMOTE_ADDR
Post by: dRfruitLOOP on June 11, 2004, 05:43:55 am
Nothing, the two lines still show up. The server's got some version of linux on it, I can check with my host if you want more specific info than that.
Title: Re: Undefined Index: SCRIPT_NAME, REMOTE_ADDR
Post by: hyperion on June 11, 2004, 05:52:04 am
Omni's looking for the server software name, too. i.e. Apache, ServerofDeath, etc.   
Title: Re: Undefined Index: SCRIPT_NAME, REMOTE_ADDR
Post by: dRfruitLOOP on June 11, 2004, 05:55:27 am
Oh ok, it's Apache as far as I know.
Title: Re: Undefined Index: SCRIPT_NAME, REMOTE_ADDR
Post by: omniscientdeveloper on June 11, 2004, 05:59:05 am
Try changing HTTP_SERVER_VARS to _SERVER or _ENV
(although I doubt this will change anything, but it's worth a shot)

-omni

Title: Re: Undefined Index: SCRIPT_NAME, REMOTE_ADDR
Post by: hyperion on June 11, 2004, 05:59:40 am
What is the PHP version number?
Title: Re: Undefined Index: SCRIPT_NAME, REMOTE_ADDR
Post by: dRfruitLOOP on June 11, 2004, 06:09:10 am
Try changing HTTP_SERVER_VARS to _SERVER or _ENV
(although I doubt this will change anything, but it's worth a shot)

-omni



Using _ENV worked, thanks very much everybody.
Title: Re: Undefined Index: SCRIPT_NAME, REMOTE_ADDR
Post by: omniscientdeveloper on June 11, 2004, 06:19:53 am
which php version are you running?
Title: Re: Undefined Index: SCRIPT_NAME, REMOTE_ADDR
Post by: dRfruitLOOP on June 11, 2004, 06:24:28 am
4.1.2
Title: Re: Undefined Index: SCRIPT_NAME, REMOTE_ADDR
Post by: hyperion on June 11, 2004, 06:27:34 am
Good to hear that the problem is solved.  For our reference, could you look in your phpinfo and tell us what the 'variables_order' setting is?  It should be a sequnce of letters.
Title: Re: [Solved]: Undefined Index: SCRIPT_NAME, REMOTE_ADDR
Post by: dRfruitLOOP on June 11, 2004, 06:35:57 am
Just says "no value" in both columns.

Thanks again for all the help
-Garrett
Title: Re: [Solved]: Undefined Index: SCRIPT_NAME, REMOTE_ADDR
Post by: omniscientdeveloper on June 11, 2004, 06:45:43 am
version: 4.3.6
mine says: variables_order = "EGPCS"
Title: Re: [Solved]: Undefined Index: SCRIPT_NAME, REMOTE_ADDR
Post by: hyperion on June 11, 2004, 06:50:04 am
Yes, this string activates or deactivates the various global variable types.  If I wanted to turn off $_ENV variables for my users, I would set it to GPCS.  In this case, PHP must be resorting to undocumented default settings for these variables since no directive is available in php.ini.