403 Error

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
OldManRiver
Forum Newbie
Posts: 7
Joined: Mon Jul 17, 2006 3:56 pm
Contact:

403 Error

Post by OldManRiver »

Been troubleshooting my WAMP on W2k Pro and Apache was working, but PHP was not. Found I had not defined the "doc_root" in the php.ini file, so changed it.

Now I get 403 errors even on the root localhost.

httpd.conf reads:

Code: Select all

ServerRoot "D:/Program Files/Apache/Apache2"
Listen 80
ServerName localhost
DirectoryIndex index.htm index.html index.html.var index.shtml index.php index.phml index.cfm index.cfml
DocumentRoot "D:/Program Files/Apache/Apache2/htdocs"
<Directory>
  Options FollowSymLinks
  AllowOverride None
</Directory>
UserDir "E:/Nyle's/Business Projects/Projects (External)"
# Config for PHP
LoadModule php5_module "D:/Program Files/PHP/php5apache2.dll"
AddType application/x-httpd-php .php
PHPIniDir "D:/Program Files/PHP"
Action application/x-httpd-php "/php/php-cgi.exe"
ScriptAlias /php/ "D:/Program Files/PHP/"
AddHandler php-script .php .phml
AddHandler php .php .phml
<Directory "D:/Program Files/PHP">
  Options
  Allow from all
  Order allow,deny
  AllowOverride None
</Directory>
php.ini reads:

Code: Select all

;include_path = ".;c:\php\includes"
doc_root = "D:/Program Files/Apache/Apache2/htdocs"
user_dir =
extension_dir = "./"
What do I need to look for or correct? Do I need to match the user directories?

Install instructions at:

http://www.devarticles.com/c/a/Apache/I ... Windows/4/

say I need to copy files into the Apache root directory, this is written for version 4 not 5. Are these still good instructions? What would change on these for version 5?

OMR
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

When you say PHP was not working, how do you mean that?
yaqeane
Forum Newbie
Posts: 12
Joined: Wed Jun 07, 2006 8:57 am

Post by yaqeane »

check back config.php trouble shoot from there.
OldManRiver
Forum Newbie
Posts: 7
Joined: Mon Jul 17, 2006 3:56 pm
Contact:

Answer

Post by OldManRiver »

Everah,

The browser (tried on both MSIE and FF) would always come up with a dialog and ask me to "Save" or "Open" the file, rather than just interpret the file and/or show it in the browser.

Yaqeane,

What config.php? Doesn't exist in PHP. That is an application file, not anything to do with PHP installation or configuration.

Did you mean php.ini? If you did you should know the only line chaged was:

Code: Select all

doc_root = 

to 

doc_root = "D:/Program Files/Apache/Apache2/htdocs"
which would change nothing in Apache and the 403 error is an Apache error, not PHP. Apache restarts without errors, so I do not know what to look at in the httpd.conf (Apache config) file to find this error. It is a security/permissions error, so need to know more about permissions, etc. to troubleshoot.

Do you have insight on permissions?

OMR
blackbeard
Forum Contributor
Posts: 123
Joined: Thu Aug 03, 2006 6:20 pm

Post by blackbeard »

Make sure that there isn't a file association for PHP. Had the same thing happen to me a few weeks back after a new desktop image was used at work.
Post Reply