Navigate
Home
ArticleWiki
Forum
Journal
Search
Newsletter
Links
Tech News
expertsrt.com
Welcome Guest.
Username:

Password:

Remember me

apache 403 error
Welcome, Guest. Please login or register.
November 23, 2008, 07:18:01 AM
11307 Posts in 1250 Topics by 501 Members
Latest Member: rosaline
Experts Round Table Network  |  Webservers  |  Apache  |  apache 403 error « previous next »
Pages: [1]
Author Topic: apache 403 error  (Read 537 times)
mcgrotty

Offline Offline

Posts: 2


« on: February 04, 2008, 06:08:02 AM »

I am sure this is an easy fix and I am probably insane for not figuring it out myself, but I can't get this problem figured out. I looked around a little bit for an answer, but didn't look too much (maybe 10 minutes), so I probably could find the information with more patience. Unfortunately, other problems, non-computer related, have taken all my patience away, so I am just going to ask for assistance.

Additionally, I am assuming this is an Apache problem and not a PHP problem.

I have a computer I use for development, which I installed Apache 2.2 and PHP5 on. It is soley for development and isn't even hooked up to the internet or network. While writing some scripts in PHP, I have no problem at all getting them to work, until I use a form. Then, whe I submit the form, I am being redirected to a 403 error page, saying the website requires me to log in to see the page. I am not sure how to log in to it, since I never set up any login information and didn't do any editing to the htaccess file.

So my question, well my two questions, are: how do I log into apache and/or is there a way to just turn off the authentication completely? As I said, the computer isn't even hooked up to any internal or external network, so security is not an issue in this case.

Thanks for any help offered.
Logged
VGR
Mentor

Offline Offline

Posts: 682



WWW
« Reply #1 on: February 04, 2008, 12:29:26 PM »

this is BASIC HTTP authentication (see the parapgrah in Apache/PHP docuentation, on top of the summary in PHP if I'm not mistaken) - http://www.php.net/manual/en/features.http-auth.php

you probably (very probably) are sending the HTTP basic authentication header values somewhere...

header('WWW-Authenticate: Basic realm="My Realm"');
header('HTTP/1.0 401 Unauthorized');
Logged

techie overlord, answers all kind of questions on http://www.europeanexperts.org
mcgrotty

Offline Offline

Posts: 2


« Reply #2 on: February 05, 2008, 06:00:29 AM »

Well, heck. I never would have found it, with it being a PHP issue. Wish I didn't have this in the Apache area of this forum, now, though. Anyway, thanks.

That being said, maybe I am more illiterate than I would have thought. I read through various help files and websites that deal with the header() function, but never found anything that worked at straightening it out. I thought it might have to do with changing the AUTH_TYPE, but couldn't see anyplace to do that. I am sure I am just overlooking something.

On the other hand, based on the code snippet mentioned here (and in the php man), does that mean that for situations where it will be looking for _SERVER authentication, I need to put in the header() functions each time? I know that a lot of people prefer to not use GLOBAL arrays when possible, but are those the only two options (assuming a global array would also be an option)? Either put in the header() function in each script or turn global arrays on?

So, I really hate doing this, but is there any chance that I could get a better explanation as to what I am  needing to do to get this to work, or at least directing me towards some little corner of the web that might be able to assist me?  This problem has me feeling really stupid.

Thanks again.
Logged
VGR
Mentor

Offline Offline

Posts: 682



WWW
« Reply #3 on: February 05, 2008, 04:50:30 PM »

in fact, I (almost) never use HTTP authentication. I just use session variables, and I force people NOT to access pages past the home if they haven't yet authenticated themwelves (for example)
Logged

techie overlord, answers all kind of questions on http://www.europeanexperts.org
Pages: [1]
« previous next »
    Jump to: