PHP file not execute except index.php
Hello,
cPanel account1:
We can able to execute any php file along with index.php like
cPanel account2:
But not able to do the same through domain like
================
Our server info as following:
[root@host2 domlogs]# /usr/local/cpanel/cpanel -V
106.0 (build 14)
[root@host2 domlogs]# cat /var/cpanel/envtype
kvm[root@host2 domlogs]# cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)
================
Can you suggest whats going wrong with our server please?
Thanks
-
Hey there! What errors do you get when you try and visit that page in a browser? Do you see any relevant logs in the Apache log at /etc/apache2/logs/error_log? 0 -
I am getting mentioned below error: [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
0 -
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. 0 -
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. 0 -
Is it possible your PHP code isn't working properly and causing that redirect issue? What if you use this code? 0 -
Yes, that's also we have tried and getting 403 forbidden error. 0 -
*Something* is causing the redirect issue on the domain. Are there any other .htaccess file on the account, possibly in /home/username? 0 -
Yes there is a htaccess with the following contents: Order allow,deny Deny from all Order allow,deny Allow from all RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L]
0 -
And what happens if you also rename that one temporarily? 0 -
Yes, now it's working. Thank you so much for your support and time. 0 -
If you can adjust some of those redirects you can likely resolve the issue, or you may find you might not need that higher-level .htaccess file at all. 0 -
Yes, we don't need that one. Thank you for your support. Have a great day ahead. Bye for now Please mark this ticket as RESOLVED. 0 -
Hello, Reopening this thread again as the said htaccess file auto generating even deleted. Dont know how can I stopt it. Could you please help me 0 -
It would be best to open a ticket - with us, if you have root access to the serer, or with your hosting provider if you only have access to the cPanel. 0
Please sign in to leave a comment.
Comments
14 comments