I am able to access some areas of the localhost but cannot access others for example,
I can access localhost/index.php
, localhost/somefolder/
but not localhost/somefolder/anotherfolder
I am also unable to include
any file from inside anotherfolder
in php because it says failed to open stream: No such file or directory
I have chmod -R 755 www
but still unable to access sub directories
what may be the cause?
Check to see if you have SELinux running on that machine. Then do a ls -alZ on the directories you can view and the ones you can't. Chances are if you have SELinux enabled, the security group for the directory you can not view in is not set to the http security group. I believe it should be something to the effect of system_u:object_r:httpd_sys_content_t
.
Check to see if SELinux is enabled on your system in /etc/selinux/config
. If it is, go to the directory that you are having trouble with and type: chcon -Rv --type=httpd_sys_content_t <directory name>
. That will add the httpd content security flag to that directory and everything under it, allowing apache to access it.