View Full Version : Undefined index: SCRIPT_FILENAME

02-18-2004, 05:51 PM
I have followed the installationg and configuration instructions found on this site but have not been able to spider my intranet or get access to /admin/install.php or /admin/index.php, all I get is a blank screen.

When I go to search.php I get the search box but above it I get the following errors:

Notice: Undefined index: SCRIPT_FILENAME in E:\inetpub\wwwroot\search\includes\config.php on line 48

Notice: Undefined index: REQUEST_URI in E:\inetpub\wwwroot\search\includes\config.php on line 48

Warning: Cannot modify header information - headers already sent by (output started at E:\inetpub\wwwroot\search\includes\config.php:48) in E:\inetpub\wwwroot\search\includes\config.php on line 293

My line 48 reads as follows:

if (eregi("config.php",$_SERVER['SCRIPT_FILENAME']) || eregi("config.php",$_SERVER['REQUEST_URI'])) {

My line 293 Reads as follows:


02-18-2004, 06:16 PM
Welcome to the forums, LowRdrCrzy!

Sorry to hear about your problems installing phpdig. If you can't get install.php to work for you, try creating your database and tables manually, using the instructions located here (http://www.phpdig.net/navigation.php?action=doc#toc4) . I ended up having to do that myself.

The other thing that might trip you up is making sure that the appropriate permission is in place for those three folders listed in the documentation.

Hope this helps. If you still have problems, post back here. We'll be glad to help. :)

02-18-2004, 06:22 PM
I did create the database manually, that is all ready to go, as far as I know the permissions are ok, but I will double check.

02-19-2004, 06:21 AM
Hi. The "cannot modify header information" error is likely showing because of the onscreen printing of the "undefined index" errors. The "undefined index" errors are showing because $_SERVER['SCRIPT_FILENAME'] and $_SERVER['REQUEST_URI'] are not recognized. From php.net (http://www.php.net/reserved.variables) is the following:

$_SERVER is an array containing information such as headers, paths, and script locations. The entries in this array are created by the webserver. There is no guarantee that every webserver will provide any of these; servers may omit some, or provide others not listed here. That said, a large number of these variables are accounted for in the CGI 1.1 specification, so you should be able to expect those.

One thing to try is to replace:

if (eregi("config.php",$_SERVER['SCRIPT_FILENAME']) || eregi("config.php",$_SERVER['REQUEST_URI'])) {

with the following:

if (eregi("config.php",$_SERVER['SCRIPT_NAME'])) {

02-19-2004, 12:52 PM
That didnt work. When I replaced that line with the one you suggested the search page redirected to the /admin/install.php page and all I got was a blank screen again.

Also, i checked the webserver security settings for those folders and they all have permission to be written to.

Still cant get the thing to work.

02-19-2004, 01:16 PM
Hi. Perhaps comment out that code and then protect the config.php file with an htaccess file if your OS/setup allows.