403 error when moving CodeIgniter app from localhost to QA server
I’ve looked in the forums (both here and on CodeIgniter.com) but haven’t found any answers that help. I have a CI 2.0.2 app that I developed locally in MAMP. It works perfectly. I copied the entire CI install up to our QA server, and am getting 403 Forbidden errors on every single page (even the default.) The file permissions are the same as all our other (non-CI) apps on that server. We don’t have a .hta开发者_运维技巧ccess file on the server anywhere, aside from the ones in the CI install. I’ve renamed those files so they shouldn’t be causing any access errors, but I still can’t get at any of my pages.
Can anyone point me in the right direction? I really don’t know where else to look at this point.
The problem you've mentioned happens most of the times when your webserver (apache) does not have read access to the application's directory. Make sure the directory has permissions of 755 and see if that works.
As Jakub has pointed out in the comments, it is generally a good practice (from security standpoint) that instead of using chmod
755 on all directories, it is better to use chown
and tie it to a user account and allow group read/write permissions. Adding apache to the user's group would remove such problems.
精彩评论