View Full Version : Installation Problems On A Second Website

02-01-2004, 08:32 PM
I've successfully installed and configured phpdig on one of my websites. Now I'm trying to do it on the other and have run into some problems.

I manually created my database and tables, assigned a username and password to the database, and I've compared what my config.php file looks like between the two websites. Everything seems in order, yet I'm getting some errors. For what it's worth, the site I'm having problems with is on a Windows server, while the one on which I successfully installed phpdig is on Linux.

Here's a sampling of the errors. Perhaps someone can tell me what I'm doing wrong. Thanks.Notice: Undefined index: SCRIPT_FILENAME in
on line 19

Notice: Undefined index: REQUEST_URI in
on line 20

02-01-2004, 11:33 PM
I got the same. Some research convinced me that this was possibly due to use of MS IIS instead of Apache. The "$_SERVER" variables are sent by the server. So that's probably it.

There is an if statement in config.php, which ensures that you are not trying to run it by itself. If you comment out the if statement it seems to work...

...although just make sure you're not loading it directly. Or wait for someone with more experience with the system

02-02-2004, 05:05 AM
Thanks for the help! That did the trick for one problem, but now I'm having another and I'm not sure how to modify the code to get around it.

When I go to the admin/index.php and get the screen that asks for my username and password, I enter those two things, and the screen comes back with:


in the username field.

www.techtipscentral.net is the domain I'm running this from.

I tried appending "www.techtipscentral.net\" to the user variable definition in both the config.php and auth.php files (sans quotes, of course), but that didn't work. I'll admit I'm out of my element on this.

I'm sure this is another Windows server related problem, but why is this tacking on the domain name and a backslash to the password, and how do I get around that one?

Side Comment: Now I know why I switched my main website to Linux. :rolleyes:

02-02-2004, 06:41 AM
Just wanted to say that I found some code on another forum here (http://www.sitepoint.com/forums/showthread.php?t=124590&highlight=windows+server+authentication) which looks like it addresses my problem. I'll work with it later today, then if I'm successful I'll post the modifications that I made to my phpdig code to get it to work.

02-02-2004, 08:22 AM
I just cannot figure this thing out. What would help, I think, is if I could make my own authentication form like that other forum's post that I mentioned. I have no idea how to modify the code to do that.

Unless someone can help, I don't think I'll be able to use phpdig on my Windows server site. :(

02-03-2004, 07:46 PM
The problem can be traced to use of $_SERVER in auth.php. This appears to be another point where the values returned by MS IIS differ from Apache.

The microsoft website (http://www.microsoft.com/technet/treeview/default.asp?url=/technet/itsolutions/migration/linux/mvc/Miglamp.asp) suggests that such authentication is impossible: however, this page (http://php.us.themoes.org/manual/en/features.http-auth.php) tells you how to go about it with PHP 4.3.3+ (near the bottom of the page, just above user comments). Haven't tested it yet, but I hope this helps.

02-03-2004, 08:17 PM
Originally posted by CCC
The problem can be traced to use of $_SERVER in auth.php. This appears to be another point where the values returned by MS IIS differ from Apache.
True. In fact, what I found by setting an echo statement in the code is that the $_SERVER variables aren't even getting set in IIS!

I have an idea on modifying the code that I think will work with IIS as well as Apache, and will likely be more secure to boot. I'm working on it right now, but haven't had much time so not much progress.

Basically, I'm going to create a form within auth.php and require the user to enter username and password there. Then I created another database with just a single table with usernames and passwords. The idea is to compare the form entry to the database to authenticate the user.

As an added measure of security, the user will get 3 tries to enter the information correctly. If they fail, they will be redirected to my home page. Hopefully, that's all it will take to have the necessary security.

If I'm successful, I'll post the code in the Mod Submissions forum. Wish me luck!