1

I'm having this error, and i can't solve it. I type

tail -f /usr/local/apache/logs/error_log

on cpanel terminal and I receive the following error:

[authz_core:error] [pid 10250]

here's my .htaccess code:

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

I'm not being able to open php files in my vps server(hostgator Apache 2.4.41), instead of opening the file, it is downloaded.

trsp
  • 78
  • 1
  • 1
  • 11
  • No, I jsut upgraded WHM. But i changed the profile in EasyApache 4, I changed to use node, but i regret so i came back to default profile. But it's not working anything now – trsp Jan 08 '20 at 02:00
  • see if this answers can help https://stackoverflow.com/questions/49664091/symfony-4-apache-2-4-mod-rewrite-not-working –  Jan 08 '20 at 02:06
  • I checked this one, not helpful – trsp Jan 08 '20 at 02:11
  • I am looking your code but cant find anything wrong in it, in case I will add mine working one try it. and delete cookies –  Jan 08 '20 at 02:20

1 Answers1

4

This isworking for me, edit it to your requirements

</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>

Client denied by server configuration

This error means that the access to the directory on the file system was denied by an Apache configuration.

Before you start

Before attempting to alter any existing config file, please take note of the full file system path for which access is being denied, and the IP or hostname of the client:

[<date here>] [error] [client ::1] client denied by server configuration: /var/www/example.com/

Using the correct path in the directory block for the following examples is essential to solving this problem. In this case, a client from the local machine (::1) is being denied access to [/var/www/example.com][1] .

Something like this should resolve your problem :

<Directory /var/www/example.com>
  Order allow,deny
  Allow from all
</Directory>

Or this one

<Directory /var/www/example.com>
  Order allow,deny
  Allow from all
  Require all granted
</Directory>

For more explanition:

https://cwiki.apache.org/confluence/display/httpd/ClientDeniedByServerConfiguration

  • I changed my htaccess with your code, but now i`m having error 403 forbidden. Follow the link http://piersoft.net/ – trsp Jan 08 '20 at 18:52
  • 1
    @Sr.Robles you might need `Require all granted` instead `deny all` or `AllowOverride All` See here it show how to set htaccess on apache https://www.linode.com/docs/web-servers/apache/how-to-set-up-htaccess-on-apache/ –  Jan 08 '20 at 19:33
  • @Sr.Robles please read your error_log file to see what is real error and see my updated answer –  Jan 08 '20 at 20:17
  • i ran a code line on cpanel terminal to see the erros logs. I got this: **[authz_core:error] [pid 12263] [client 51.158.121.128:39998] AH01630: client denied by server configuration: /home/wwpier/public_html/index.php** I tried to use the directory tag, but i get error 500(internal server error). And thats what i get when running error log: **[core:alert] [pid 10247] [client 191.212.139.92:50644] /home/wwpier/public_html/.htaccess: – trsp Jan 08 '20 at 22:26
  • I removed the .htaccess from the root, and installed the easyApache profile again, now the php files are being downloaded instead of being opened in browser. My htaccess file is like that: `# php -- BEGIN cPanel-generated handler, do not edit # Defina o pacote “ea-php56” como a linguagem padrão de programação “PHP”. AddHandler application/x-httpd-ea-php56 .php .php5 .phtml # php -- END cPanel-generated handler, do not edit` – trsp Jan 08 '20 at 23:03