Search code examples
phpapacheapache-configapache2.2

How to change apache 2.2 htdocs folder out side of apache folder?


Hi I want to store my php project folder out side apache folder. How can I do that?

I changed my DocumentRoot "C:/sbnproj" like this.

after that I created one folder named mytest.php and write

<?php 

phpinfo();

?>

This code on that. But when I try to access http://localhost/

is working but when I type http://localhost/mytest.php is not working. it shows

Forbidden

You don't have permission to access /mytest.php on this server.

Why this happening please help me. Thanks


Solution

  • You need a trailing forward slash.

    C:/sbnproj/
    

    Also, check your paths... if your getting the root page it's working, make sure C:/sbnproj/foldername/ exists.