我遇到了这个错误,我无法解决它。 我输入
tail -f/usr/local/apache/logs/error_log
在cpanel终端上,我收到以下错误:
[authz_core:错误] [PID 10250]
这是我的.htaccess代码:
<IfModule authz_core_module>
Require all granted
</IfModule>
<IfModule !authz_core_module>
Require all denied
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
我无法在我的 vps 服务器(hostgator Apache 2.4.41(中打开 php 文件,而不是打开文件,而是下载它。
这对我有用,请根据您的要求进行编辑
</VirtualHost>
<Directory /var/www/html/example.com/public_html>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
客户端被服务器配置拒绝
此错误意味着 Apache 配置拒绝了对文件系统上目录的访问。
开始之前
在尝试更改任何现有配置文件之前,请记下拒绝访问的完整文件系统路径,以及客户端的 IP 或主机名:
[<date here>] [error] [client ::1] client denied by server configuration: /var/www/example.com/
对于以下示例,在目录块中使用正确的路径对于解决此问题至关重要。在这种情况下,来自本地计算机 (::1( 的客户端被拒绝访问[/var/www/example.com][1]
。
这样的事情应该可以解决您的问题:
<Directory /var/www/example.com>
Order allow,deny
Allow from all
</Directory>
或者这个
<Directory /var/www/example.com>
Order allow,deny
Allow from all
Require all granted
</Directory>
有关更多解释:
https://cwiki.apache.org/confluence/display/httpd/ClientDeniedByServerConfiguration