"_SERVER["SCRIPT_FILENAME"] has no value

6 posts / 0 new
Last post
#1 Tue, 03/01/2011 - 04:12
Dim Git

"_SERVER["SCRIPT_FILENAME"] has no value

Hi everybody,

This is way over my head I'm afraid so I have to, once again, beg your help.

I am trying to run a script (Snippetmaster, a very simple CMS for dummies) which I have run on other servers without a problem but it won't run on this box. It uses IonCube.

I have contacted the authors who have dug around some and replied with the following :-


The problem is that Snippetmaster uses the PHP standard "$_SERVER["SCRIPT_FILENAME"]" variable to determine what is the file path to the script currently being executed. Go to http://www.the-domain.co.uk/includes/diag/phpinfo.php

If you do a search on the phpinfo page above for "_SERVER["SCRIPT_FILENAME"] " and you'll see there is no value. This is very unusual, because according to PHP documentation, this variable should always be set to something, since a script is always being run in order to produce the output you see. (ie. In the case of the phpinfo.php script above, the variable should contain the
path to the phpinfo.php script.)


Here's a link to the PHP documentation showing what this variable should contain: http://www.php.net/manual/en/reserved.variables.server.php (Do a search on that page for "SCRIPT_FILENAME".)

So according to my PHP developer admins, the PHP config on your server is screwy because this value should never be empty. I'm not sure what to suggest, as I (or my admins) have no idea why this would be empty variable on your server... maybe contact your hosting admin and see if they have any suggestions?

Err - Umm - Right ...

Where do I go from here?

CentOS Linux 5.5
Webmin version 1.530
Virtualmin version 3.83 Pro

Can anyone offer any smattering of advice please.

Thanks for reading,
Tim

PS. Apologies for all the individual quotes above, I couldn't get them to work all in one.

Tue, 03/01/2011 - 12:29
andreychek

Hmm, I'm not sure why you'd be seeing that problem -- the SCRIPT_FILENAME variable is set on my particular setup here.

One thing you might try is to see if it's set when using a different PHP Execution Mode.

To change the mode, go into Server Configuration -> Website Options, and change the PHP Execution mode. If you're using FCGID, try changing it to CGI, for example.

-Eric

Tue, 03/01/2011 - 23:41
Dim Git

Ah! that fixed it. Thanks Eric.

Now the question needs to be asked, is that a problem which needs sorting out, or is it something I have done. The only thing I have done outside WM/VM is to install Fail2Ban.

Tim

Wed, 03/02/2011 - 09:05 (Reply to #3)
Dim Git

Hmmm!

I have just installed Zen Cart. The admin page wouldn't work until I did the same for this domain too.

:o(

Wed, 03/02/2011 - 11:42
andreychek

I hadn't heard of anyone else having those problems before... but it's possible that FCGID isn't setting those variables for some reason.

Both CGI and FCGID should be using the same php.ini file, so it's not likely a configuration issue.

I'd probably suggest just going with CGI where you have those problems :-)

-Eric

Thu, 03/03/2011 - 22:15
Dim Git

OK, thanks for your help Eric. :)

Topic locked