Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting this error: You don't have permission to access 2

Status
Not open for further replies.

milo3169

Programmer
May 2, 2007
42
I tried to ask this question in the apache forum and after trying to deduct the problem they said that it sounded like a PHP problem and they pointed me here. So I'm going to ask the question to see if this is a PHP prolem

Hello,
I installed Apache, PHP5, and MySql on my new computer and It seems like the installation was ok. The problem I have I would try to access some files and I would get this error.

Forbidden
You don't have permission to access on this server.

Apache/2.0.61 (Win32) PHP/5.2.5 Server at localhost Port 80

Does anybody know what this means and how I can fix this? I've never experienced this before.

Thanks in advance.
 
FWIW, thread65-1443554 concluded that static pages can be served from the directory in question and that the code worked worked until php4 was upgraded to php5.
 
sounds like permissions to me. you must make sure that the directory you are trying to get the information from is (at least) readable by the user under whose credentials apache is running (sometimes 'nobody', sometimes' apache' or similar).
 
That's what I was thinking, but I'm new to setting this up and I don't know how or where it is that I have to set that up. Would you be able to tell where it is I have to set the permisions for this?
 
A good question in this kind of situation is "can root access the resource without the error?"
 
to set permissions right click on the relevant directory and select the security menu item. if this is not visible then you have the wrong type of sharing enabled on your PC (check out MS support to find out how to change this).

the php installation notes have plenty of instructions on which directories and files need what security.
 
Thanks guys for all of your help. I figured out what was happening. Where the problem was occuring was in a login form. The action in the form was
Code:
<form action="<? $SERVER['PHP_SELF'] ?>" method="POST">

It seems like it crashed because I didn't have "PHP" in the opening tag. My php.ini file was set so that php has to be in the open tag. Anyways, I put that in there and it works great. Thanks guys!
 
that is vanishingly unlikely to have been the issue. in such case, php simply would not have parsed the enclosed text.

also the variable you were (probably) trying to reference is not called $SERVER but [red]$_SERVER[red] (note the underscore.

but i'm glad it's working for you. it may have been rebooting or stopping and starting the web server that did it for you. You must do so after every change to php.ini.

 
jpade, sorry, $SERVER[red] was a typo. I did mean to write $_SERVER[red]. I'm not sure what happened, but it works. Thanks again for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top