SOLVED PHP file not execute except index.php

Tarak Nath

Well-Known Member
Mar 12, 2018
119
15
68
India
cPanel Access Level
Root Administrator
Hello,

cPanel account1:
We can able to execute any php file along with index.php like http://domain1.com/index.php or http://domain1.com/test.php

cPanel account2:
But not able to do the same through domain like http://domain2.com/test.php. Please note that index.php is working like http://domain2.com/index.php
================
Our server info as following:
[[email protected] domlogs]# /usr/local/cpanel/cpanel -V
106.0 (build 14)
[[email protected] domlogs]# cat /var/cpanel/envtype
kvm[[email protected] domlogs]# cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)
================
Can you suggest whats going wrong with our server please?

Thanks
 

Tarak Nath

Well-Known Member
Mar 12, 2018
119
15
68
India
cPanel Access Level
Root Administrator
I am getting mentioned below error:

Code:
[Fri Feb 03 15:12:15.302122 2023] [access_compat:error] [pid 7987:tid 47570529302272] [client 123.45.67.89:53229] AH01797: client denied by server 
configuration: /home/username/public_html/test.php
[Fri Feb 03 15:12:15.303907 2023] [core:error] [pid 7987:tid 47570529302272] [client 123.45.67.89:53229] AH00124: Request exceeded the limit of 10 internal 
redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Fri Feb 03 15:12:15.894265 2023] [core:error] [pid 7987:tid 47570437195520] [client 123.45.67.89:53230] AH00124: Request exceeded the limit of 10 internal 
redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace., referer: http://domain2.com/test.php
[Fri Feb 03 15:12:15.894342 2023] [core:error] [pid 7987:tid 47570437195520] [client 123.45.67.89:53230] AH00124: Request exceeded the limit of 10 internal 
redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace., referer: http://domain2.com/test.php
[Fri Feb 03 15:12:53.903861 2023] [core:error] [pid 7872:tid 47570525099776] [client 98.76.54.321:60486] Script timed out before returning headers: index.php
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
15,235
2,422
363
cPanel Access Level
Root Administrator
Thanks for the additional details. It looks like there is a problem with the .htaccess configuration on the domain. Can you renmae /home/username/public_html/.htaccess to .htaccess.bak so it can't be read by the system, and see if the PHP page loads? If so, you'll need to adjust the redirects for PHP in the .htaccess file, as that is what is causing the issue.
 

Tarak Nath

Well-Known Member
Mar 12, 2018
119
15
68
India
cPanel Access Level
Root Administrator
Thank you for the prompt response.
I don't think so as we have tired the same by rename the htaccess file.
Even we have created a subdomain and there is no any htaccess file. Like:
Subdomain name: testxyz.domain2.com
Subdomain doc root directory: /testxyz.domain2.com [ under home not in public_html]

And the issue still persist.

Please help.
 

Tarak Nath

Well-Known Member
Mar 12, 2018
119
15
68
India
cPanel Access Level
Root Administrator
Yes there is a htaccess with the following contents:

Code:
<FilesMatch ".(py|exe|php)$">
 Order allow,deny
 Deny from all
</FilesMatch>
<FilesMatch "^(about.php|radio.php|index.php|content.php|lock360.php|admin.php|wp-login.php)$">
 Order allow,deny
 Allow from all
</FilesMatch>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>