Undefined index: SCRIPT_FILENAME
  • Hi, im using IE 6, and FF 2, i have the latest version just downloaded today, and set up, the site link is found at (http://roblyneyriefarm.net/new/minishowcase_v09b73/index.php) im getting an error on the page [Notice: Undefined index: SCRIPT_FILENAME in C:\Accounts\roblyne1\wwwRoot\new\minishowcase_v09b73\libraries\general.init.php on line 10]
    im not sure why im getting this error, i have followed every step of the instalation to a T.

    attached i have a copy of my settings file too, in case this helps...?

    you can get a list of my php values according to my server, from here (http://roblyneyriefarm.net/test.php)

    Any help would be great, thanks.
  • did you check all requirements? could you tell me your php version?

    SCRIPT_FILENAME is an index of the global _SERVER variable. it is very strange you don't have it active....
  • ok, just open
    /libraries/general.init.php
    and substitute (on line 10):

    if (dirname(__FILE__) != dirname($_SERVER['SCRIPT_FILENAME'])) {

    if (dirname(__FILE__) != dirname($_SERVER["DOCUMENT_ROOT"].$_SERVER['PHP_SELF'])) {

    or if you prefer, just delete the whole code snippet:

    if (dirname(__FILE__) != dirname($_SERVER['SCRIPT_FILENAME'])) {
    if (!isset($settings['minishowcase_url'])
    || ($settings['minishowcase_url'] == "")) {
    die ("... code here ...");
    }
    }

    (it is really not tested to be useful right now)

    the reason is that the
    _SERVER
    global index
    SCRIPT_FILENAME
    seems to be an Apache-only variable, and your server is IIS (Windows)

    i already changed the code for the next release, thanks.
  • thanks that worked, i just removed that whole snippet for now.
  • i just looked over my php test page, i have this...
    _SERVER["SCRIPT_NAME"] /test.php

    is that ok to swap for the _SERVER["SCRIPT_FILENAME"] ?
  • not really.

    they (should) output:
    $_SERVER["SCRIPT_FILENAME"] = C:\path\to\your\page\test.php
    $_SERVER["SCRIPT_NAME"] = /test.php

    they're different.
  • [quote=victor][/quote]

    i think you ment to have them the other way around? or else it would work with my server?
  • yes, i just corrected it. thanks.