我正在使用Codeigniter3.0.4,现在更改为二手Mac计算机和Xampp服务器但是我得到了以下错误。
[2016 年 3 月 1 日星期二 22:31:29.108763] [核心:暴击] [PID 2115] (13)权限被拒绝: [客户端 ::1:56770] AH00529:/Applications/XAMPP/xamppfiles/htdocs/dw_php-json-js/.htaccess pcfg_openfile:无法检查 htaccess 文件,确保它是可读的,并且"/Applications/XAMPP/xamppfiles/htdocs/dw_php-json-js/"是可执行
首先,您应该确定 XAMPP 正在运行的用户。然后,您应该通过在终端上运行以下命令来找出该用户所属的组:
groups <username>
<username>
是运行 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
这告诉你所有者是根,组是轮子。用户具有rw
(读取和写入)访问权限,组中的任何人都具有r
(读取)访问权限,并且每个人都具有r
访问权限。
要根据您收到的错误消息确保权限正确,您需要确保用户可读.htaccess
并且目录是可执行的(显示为r
和w
旁边的x
)。