当从本地主机到QA服务器移到403错误codeIgniter应用移到、错误、主机、服务器

2023-09-02 20:40:32 作者:梦醒梦醉梦已碎

我看在论坛中(都在这里和codeIgniter.com),但没有找到任何答案,帮助。我有一个CI 2.0.2应用程序,我在MAMP本地开发。它完美。我复制了整个CI安装到我们的QA服务器,我得到的每一个页面上403禁止错误(甚至默认)。该文件的权限是一样的我们所有其他(非CI),该服务器上的应用程序。我们不从那些在CI安装在服务器上的.htaccess文件的任何地方,一边。我已经改名的文件,所以他们不应该造成任何访问错误,但我仍然不能得到任何我的网页。

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 .htaccess 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.

推荐答案

你提到的问题发生大部分的时间,当你的网络服务器(Apache的)没有读访问应用程序的目录。确保目录有755权限,看看是否可行。

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.

作为的Jakub已经指出的评论,它通常是一个好习惯(从安全角度来看),而不是使用的搭配chmod 755上的所有目录,这是更好地使用 CHOWN ,并将其绑到用户帐户,并允许组读/写权限。添加阿帕奇到用户的组将消除这些问题。

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.