【问题标题】:Getting a 403 error after upgrading to php5.5升级到 php5.5 后出现 403 错误
【发布时间】:2013-09-07 16:19:12
【问题描述】:

好的,我刚开始在 stackoverflow 上提问,但我需要弄清楚这一点。我有一个安装了 Apache 的 VPS,运行 Ubuntu 12.04 LTS。我下载了一个需要 php 5.4+ 的 php 脚本,但我安装了 5.3。然后我按照位于this link. 的说明进行操作 在进行升级时,安装程​​序告诉我我的 php.ini 文件已手动更改。我相信我这样做是为了在很久以前使用 "display_errors=on" 变量查看屏幕上的错误。因此,我选择了保留并使用旧版本的 php.ini 选项。安装完成并重新启动 apache 服务器后。我打开我的 chrome 浏览器并按下 “刷新”,令我沮丧的是,“403 Forbidden”

这是虚拟服务器的配置文件:

<VirtualHost *:80>
    ServerAdmin webmaster@localhost

    DocumentRoot /home/{usr}/Public/
    # Indexes + Directory Root.
    DirectoryIndex  index.html index.shtml index.php
    <Directory />
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
    </Directory>
    <Directory /home/{usr}/Public/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
    </Directory>

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
        AllowOverride None
        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Order allow,deny
        Allow from all
    </Directory>

    ErrorLog /home/{usr}/Public/log/{server}/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog /home/{usr}/Public/log/{server}/access.log combined

     Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>

</VirtualHost>

我隐藏了 {usr} 的用户名和 {server} 的文件夹以保持匿名。这个文件是由我创建的,将它与其他一些示例文件放在一起。我不确定这是否正确,我只知道在这次升级之前,一切正常!

我还 “LL” 找到了 “Public” 文件夹,这是我找到的:

drwxrwxrwx 28 {usr} {usr}   4096 Sep  4 01:09 Public/

好像它下面的所有文件夹都具有相同的权限。请帮助,如果有任何问题,请随时提问。我已经这样做了很多年,但我绝不会称自己为“专家”。

提前致谢。

【问题讨论】:

    标签: php ubuntu apache2 upgrade chmod


    【解决方案1】:

    您是否还升级了 Apache 2? Apache 2.4 有一个新的用户权限策略系统:http://httpd.apache.org/docs/2.4/upgrading.html#run-time

    【讨论】:

    • 我目前正在运行 Apache 2.4.6
    • 在 Apache 2.4.x 中,“Order allow,deny Allow from all”不再存在。它已被替换为:要求全部授予
    • 好的,我替换了你写下的 .conf 文件,让它再次工作。谢谢你。我现在为stackoverflow做什么?我试着给你投票,但它不允许我,因为我没有足够的声誉。
    • 继续探索stackoverflow,并尝试帮助人们;)
    猜你喜欢
    • 2015-06-03
    • 2014-06-13
    • 1970-01-01
    • 2013-10-29
    • 2020-01-19
    • 2014-10-06
    • 1970-01-01
    • 2021-09-26
    • 2011-06-23
    相关资源
    最近更新 更多