Forum Moderators: phranque

Message Too Old, No Replies

Segmentation Fault on Custom 413

         

balia

4:18 am on Jan 19, 2015 (gmt 0)

10+ Year Member



First, I added the following lines to my .htaccess file:


ErrorDocument 413 /413.php
# Limit Transfers from client 1MB
LimitRequestBody 1048576



The content of 413.php is:

$sBody="The requested resource does not allow request data with POST requests, or the amount of data provided in the request exceeds the capacity limit.";
$sHtm="<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">
<html><head>
<title>413 Request Entity Too Large</title>
</head><body>
<h1>413 Request Entity Too Large</h1>
$sBody</body></html>";
echo $sHtm;


When I try to upload a 2.3MB image, the following setup works and 413.php is displayed.


Then, I modify my 413.php by adding just one line at the top:

if(!defined('_HttpERR_')) define('_HttpERR_',413);
$sBody="The requested resource does not allow request data with POST requests, or the amount of data provided in the request exceeds the capacity limit.";
$sHtm="<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">
<html><head>
<title>413 Request Entity Too Large</title>
</head><body>
<h1>413 Request Entity Too Large</h1>
$sBody</body></html>";
echo $sHtm;


then I get a "Connection reset" notification instead of my custom 413.php and /var/log/apache2/error.log contains

[core:notice] [pid 1951] AH00051: child pid 24179 exit signal Segmentation fault (11), possible coredump in /etc/apache2


How do I resolve this?
Thank you.

PS: I am running Apache 2.4 with PHP 5.6 on Ubuntu 12.04 LTS

lucy24

8:38 am on Jan 20, 2015 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Just so you know we're not ignoring you: Unlike most questions asked in this subforum, this one requires someone who actually speaks Apache. And php. So hang in there.

Meanwhile, you can always sweep the problem under the rug by using a hard-coded html error document instead ;)