Apache Logo

The requested URL’s length exceeds the capacity limit for this server.

I haven’t posted in a while just just had an error that I thought others may benefit from knowing the answer to.

While executing a PHP command I got the error

The requested URL’s length exceeds the capacity limit for this server.

This is caused by the Apache limits the set a size of a client’s HTTP request-line (e.g. <HTTP METHOD> <URL> <protocol version>) and the HTTP request header field size. So the default values will need to be increased if the request URL is this large.
Increase the URI length limit in the Apache configuration file (by default it is /etc/httpd/conf/httpd.conf ):

LimitRequestLine 16380
LimitRequestFieldSize 16380
Increase these to values to accommodate the URL length