Page 1 of 1
Undefined index: SCRIPT_FILENAME
Posted: Sat Oct 25, 2003 10:18 am
by maniac9
I just moved everything over from Apache to IIS, and now I'm getting this error message suddenly...
Notice: Undefined index: SCRIPT_FILENAME
The code causing this is...
if (realpath(__FILE__) == realpath($_SERVER['SCRIPT_FILENAME'])) exit;
I've used this plenty of times in IIS, and I'm pretty sure I kept my old php.ini - any ideas of what could be going on?
Posted: Mon Oct 27, 2003 3:10 am
by twigletmac
Check the output of
Code: Select all
echo '<pre>';
print_r($_SERVER);
echo '</pre>';
check and see what's being set, maybe you need to use another element.
Mac
Posted: Mon Oct 27, 2003 8:27 am
by maniac9
Odd...
SCRIPT_FILENAME has always been there, but it isn't now...
I'm checking back through my ini to see if there might be something stupid I missed. I made sure all of the document roots were set and correct and everything, but with no luck
Posted: Mon Oct 27, 2003 8:31 am
by m3rajk
you're on M$IIS now.
as a friend uses for his motto: "linux, because i actually want to GET there."
he's been using that since M$ came out with "where do you want to go today?"
remember M$ thinks it's above standards and only conforms to them when forced to. look at what it gives, there may be an equivalent.
personally i think the world should unassimilate and get off winblows and use the flavor of posix that they each like best.....every one's different, but they're all compatible
Posted: Mon Oct 27, 2003 8:36 am
by maniac9
sorry, but this isn't an anti M$ thread, even though I hate them too
this WAS working on IIS fine, better than on apache, actually...
Posted: Mon Oct 27, 2003 8:45 am
by twigletmac
Is it a different version of IIS? Unfortunately this is one thing that can make it difficult to port PHP apps - configuration settings on the web server affecting $_SERVER variables.
Mac
Posted: Mon Oct 27, 2003 9:08 am
by maniac9
I don't know...
The server that ran these scripts was windows 2003, IIS version 6.0 - but, I still developed them on XP, which is version 5.1
I think the problem may just lie in some weird configuration problem - I'll try these on my server when I get it back up...thanks for the help...
Posted: Wed Jul 14, 2004 7:07 am
by anjanesh
Hi
Same problem.
At the Co $_SERVER['SCRIPT_FILENAME'] works fine but at home (Win 2k3 Server IIS 6) its showing undefined index. Thats odd because before I had php4.3.4 and I think it worked there. Now I'm having php4.3.7.
maniac9 - What ver of php are you using now ?
Thanks