Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

i've set the documentroot in httpd.conf as:

DocumentRoot "C:\Users\user1\Documents\WebProjects"

if the files are located in WebProjects, they work; however if i create a sub folder [project] in WebProjects and access them via the browser, it doesn't load. for example, if i create a folder 'test' in WebProjects and a php file called test.php and call it: localhost/test/test.php . .this won't work and give the error of file not found on server.

but if i put all the files in WebProjects itself, ie. test.php in WebProjects, it will work [localhost/test.php]. this makes my WebProjects folder look very cluttered with different files of different projects strewn around. and it isn't practical either.

i'm new to using apache and hence would like to know how to set the document root such that i can access and load all the Projects/folders in WebProjects.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

A couple of things to try:

  1. Check the Windows permissions on the "test" folder - my guess would be that the account that Apache is running as doesn't have read permission on the folder (and so can't see the PHP files inside it). You could also try looking at the permissions on the "WebProjects" folder - somewhere in the Advanced options there should be a way to force the permissions to apply to "child objects" - i.e. files/folders inside WebProjects.
  2. Check the Apache error log to see if it gives a reason why it cannot find the file. You could also try changing the error logging level - look for the LogLevel directive in the config file - default is "warn", but "info" or "debug" will give more information.
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.