Problem 1: Can’t serve files on a custom directory
The first problem I have encountered is that I tried to setup the application inside /var/www/html/sites/mysite
. When viewed on the browser, it says 403 Forbidden and error logs says:
13)Permission denied: [client 121.54.44.93:23180] AH00529: /var/www/html/sites/mysite/
.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that '/var/www/html/sites/mysite/' is executable
The directory structure has proper ownership and permissions, ex: directory is owned by apache:apache
, file permission is 0644
and directory permission is 0755
. It doesn’t make sense at all. I noticed though that the default document root has no problem serving the php file so I decided to serve it off the /var/www/html/mysite
directory, which is the default document root.
Problem 2: Can’t write to file
Moving to the default document root directory did the trick and I was able to run the application but with errors. The error says it can’t write to file although again, proper permissions are already set to the directory. Below is the error (it is a custom error log, but if writing to log file doesn’t work, imagine how your upload functionality would work):
PHP Warning: fopen(/var/www/html/mysite/application/config/../../logs/web/20150708.ALL.log