【问题标题】:unable to check htaccess file in Xampp无法在 Xampp 中检查 htaccess 文件
【发布时间】:2016-06-14 04:11:44
【问题描述】:

我正在使用 Codeigniter3.0.4,现在改用 mac 电脑和 Xampp 服务器,但出现以下错误。

[Tue Mar 01 22:31:29.108763 2016] [core:crit] [pid 2115] (13)Permission denied: [client ::1:56770] AH00529: /Applications/XAMPP/xamppfiles/htdocs/dw_php- json-js/.htaccess pcfg_openfile: 无法检查 htaccess 文件,确保它是可读的并且 '/Applications/XAMPP/xamppfiles/htdocs/dw_php-json-js/' 是可执行的

【问题讨论】:

    标签: php macos apache .htaccess xampp


    【解决方案1】:

    首先,您应该确定运行 XAMPP 的用户。然后,您应该通过在终端上运行它来找出该用户属于哪些组:

    groups <username>
    

    &lt;username&gt; 是运行 XAMPP 的用户。

    然后您可以检查错误消息中提到的文件的权限和所有权:

    # Check owner and permissions for .htaccess file:
    ls -al /Applications/XAMPP/xamppfiles/htdocs/dw_php-json-js/.htaccess
    # Check owner and permissions of containing directory
    ls -l /Applications/XAMPP/xamppfiles/htdocs/dw_php-json-js/
    

    此类命令的示例输出如下:

    # Command: ls -l /Applications/iTunes.app/Contents
    -rw-r--r--    1 root  wheel    521 16 Oct 12:48 version.plist
    

    这告诉你所有者是root,组是轮子。用户拥有rw(读取和写入)访问权限,组中的任何人都拥有r(读取)访问权限,每个人都拥有r 访问权限。

    要根据您收到的错误消息确保权限正确,您需要确保用户可以读取.htaccess 并且该目录是可执行的(显示为x 旁边的r 和@987654331 @)。

    【讨论】:

    • 我正在使用 Mac 我是新用户,在我的网站目录中找不到 .htaccess
    • 你知道如何打开终端并导航到正确的目录吗?
    猜你喜欢
    • 2016-02-07
    • 2011-09-12
    • 1970-01-01
    • 2021-02-25
    • 2013-05-25
    • 1970-01-01
    • 2013-12-09
    • 2016-02-09
    • 1970-01-01
    相关资源
    最近更新 更多