500 Internal Server Error - Request exceeded the limit of 10 internal redirects

chiareu

Member
Feb 8, 2016
14
0
1
Bucharest
cPanel Access Level
Root Administrator
I am getting the following error when running a PHP web application on fresh installation of CentOS 7 (64bit) with latest version of cPanel:

500 Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

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.

Interesting is that after 2-3 refresh the page is loaded and after few clicks again 500 ISE

It just happened to me yesterday. All websites and applications written on php have same issue.
WP, Magento, custom php apps.
Even in fresh installed WP with only default .htaccess
Already tested various solutions proposed over forum. Nothing works.

CENTOS 7.6
WHM v78.0.12
PHP 7.2 (ea-php72)
php handlers: suphp
System PHP-FPM
 

chiareu

Member
Feb 8, 2016
14
0
1
Bucharest
cPanel Access Level
Root Administrator
:) Of course, that was first try. The problem occurred on all browsers, different ISP/locations.
To get websites work again I closed the PHP-FPM for all websites and run php as fcgi.

So seams that there are some issue with PHP-FPM on last update; as I say, Wordpress, Magento, Drupal, custom php app, all failed to work. Intermittent error 500, no mater that was https or simple http.
 

cPanelLauren

Forums Analyst II
Staff member
Nov 14, 2017
8,012
648
263
Houston
cPanel Access Level
DataCenter Provider
Hi @chiareu

The issue is, this is not occurring on other servers so my assumption is that it's some part of the configuration you have present causing the issue. Do you have any Apache includes/customizations in place? Is there a specific error besides the redirect error in the apache error logs that provides any indication of the issue?
 

chiareu

Member
Feb 8, 2016
14
0
1
Bucharest
cPanel Access Level
Root Administrator
Nope, Apache run with as configured by WHM.
Usually I have allowed memory size errors.
HP Fatal error: Allowed memory size of 2097152 bytes exhausted (tried to allocate 20480 bytes)
 

chiareu

Member
Feb 8, 2016
14
0
1
Bucharest
cPanel Access Level
Root Administrator
What it's really strange is that on Home »Software »MultiPHP INI Editor - memory_limit = 256

If PHP run as suphp with php-fpm i have internal server error
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.

If PHP run as suphp - NO FPM - runs OK but slow

Other option is to run PHP as fcgid, but with usual limits
 
Last edited:

cPanelLauren

Forums Analyst II
Staff member
Nov 14, 2017
8,012
648
263
Houston
cPanel Access Level
DataCenter Provider
What it's really strange is that on Home »Software »MultiPHP INI Editor - memory_limit = 256
One thing to be sure of is it's set to that for the PHP version the site is using.

If PHP run as suphp with php-fpm i have internal server error
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.
I'd be inclined to assume there's something in the .htaccess causing this or something specific to the configuration of that site, unless it's occurring on all sites which would be fairly odd unless there was an apache include configuration issue.
 

chiareu

Member
Feb 8, 2016
14
0
1
Bucharest
cPanel Access Level
Root Administrator
Thank's for your help Lauren,
I just figured that one was my mistake :( memory_limit = 256... there suppose to be 256M...bip bip M.
Now the memory are loaded as it should.

Anyway the old redirect loop are still present and php run as fcid (the only way the server work at least)
In my apache pre_main_global.conf I have few settings:
Code:
SSLHonorCipherOrder On
SSLProtocol all -SSLv2 -SSLv3
Header set X-XSS-Protection "1; mode=block"
Header set Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
Header always append X-Frame-Options SAMEORIGIN
Header set X-Content-Type-Options nosniff
#Header set Content-Security-Policy "default-src 'self';"
Header set X-Permitted-Cross-Domain-Policies "none"
#Header set Referrer-Policy "same-origin"
And in pre_virtualhost_global.conf
Code:
<IfModule mod_fcgid.c>
FcgidMaxRequestLen                      1073741824
</IfModule>
Now, constantly observe the error on apache logs
Code:
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.
So I changed to 'debug' and voila:

Code:
[Fri Mar 01 14:56:19.155171 2019] [core:debug] [pid 9187:tid 47730931373824] core.c(3838): [client 123.456.78.90:37572] AH00121: r->uri = /403.shtml
[Fri Mar 01 14:56:19.155180 2019] [core:debug] [pid 9187:tid 47730931373824] core.c(3845): [client 123.456.78.90:37572] AH00122: redirected from r->uri = /403.shtml
[Fri Mar 01 14:56:19.155197 2019] [core:debug] [pid 9187:tid 47730931373824] core.c(3845): [client 123.456.78.90:37572] AH00122: redirected from r->uri = /403.shtml
[Fri Mar 01 14:56:19.155207 2019] [core:debug] [pid 9187:tid 47730931373824] core.c(3845): [client 123.456.78.90:37572] AH00122: redirected from r->uri = /403.shtml
[Fri Mar 01 14:56:19.155216 2019] [core:debug] [pid 9187:tid 47730931373824] core.c(3845): [client 123.456.78.90:37572] AH00122: redirected from r->uri = /403.shtml
[Fri Mar 01 14:56:19.155225 2019] [core:debug] [pid 9187:tid 47730931373824] core.c(3845): [client 123.456.78.90:37572] AH00122: redirected from r->uri = /403.shtml
[Fri Mar 01 14:56:19.155234 2019] [core:debug] [pid 9187:tid 47730931373824] core.c(3845): [client 123.456.78.90:37572] AH00122: redirected from r->uri = /403.shtml
[Fri Mar 01 14:56:19.155243 2019] [core:debug] [pid 9187:tid 47730931373824] core.c(3845): [client 123.456.78.90:37572] AH00122: redirected from r->uri = /403.shtml
[Fri Mar 01 14:56:19.155252 2019] [core:debug] [pid 9187:tid 47730931373824] core.c(3845): [client 123.456.78.90:37572] AH00122: redirected from r->uri = /403.shtml
[Fri Mar 01 14:56:19.155261 2019] [core:debug] [pid 9187:tid 47730931373824] core.c(3845): [client 123.456.78.90:37572] AH00122: redirected from r->uri = /403.shtml
[Fri Mar 01 14:56:19.155270 2019] [core:debug] [pid 9187:tid 47730931373824] core.c(3845): [client 123.456.78.90:37572] AH00122: redirected from r->uri = /index.php
Now this kind of actions put the server down :(
 

cPanelLauren

Forums Analyst II
Staff member
Nov 14, 2017
8,012
648
263
Houston
cPanel Access Level
DataCenter Provider
Hi @chiareu

I just figured that one was my mistake :( memory_limit = 256... there suppose to be 256M...bip bip M.
I'm glad you caught it!


Now this kind of actions put the server down :(
And what is in the .htaccess for this domain as well as what are the permissions/ownership? Are you using a CMS and if so is it possible you've set a different home URI within the CMS?

Thanks!