After an OS update, "bigger" HTTP requests are no longer handled correctly by the web server/PHP/MediaWiki. Wiki article content is truncated after about 6K characters and MediaWiki reports a loss of session.
Symptoms: I first recognized the error with my formerly working installation of MediaWiki (PHP). When I edit an article and its size grows bigger than approx. 6k characters, the article text is truncated and the MediaWiki rejects to save the new text but reports a lost session error. Smaller articles are not affected.
Question: Is this possibly a bug in PHP? Should I file a bug report? Or am I doing something wrong? Is something misconfigured?
Context: At home, I recently updated my raspbian LAMP server from wheezy to jessie. It all worked well before.
- Operating system: Raspbian jessie (formerly wheezi) on a Raspberry Pi.
- Apache 2.4.
- phpinfo() shows no indication of suhosin, which is sometimes reported to cause problems with larger http requests. Also, other PHP parameters that are sometimes mentioned as relevant on the web are unsuspicious: PHP Version 5.6.24-0+deb8u1. max_input_time=60, max_execution_time=30, post_max_size=8M
What I tried so far:
- Other PHP program: To investigate further, I uploaded files through a simple PHP file upload script. Similar problem; file upload does not work. (For your reference, the code of the upload script was taken from here: http://www.codingcage.com/2014/12/simple-file-uploading-with-php.html The script uses simple form data, no Ajax, no JSON, ...)
- Larger file causes split: Moreover, larger http file upload requests (using files of several hundred KB) are seemingly split into two requests. The apache access log file shows (remember this is actually only a single request from the browser):
- ... - - [05/Aug/2016:10:52:38 +0200] "POST /simpleupload.php HTTP/1.1" 200 85689 "https://.../simpleupload.php" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Firefox/38.0"
- ... - - [05/Aug/2016:10:52:38 +0200] "\xb4W\xcd\xff" 400 557 "-" "-" -
- Other browsers: The behavior can be replicated with different browsers: Firefox on Linux, Firefox 38 on Windows, and elinks browser on same machine.
- Eliminate network problems: I used elinks to access the webserver on localhost. Same problems in MediaWiki and the PHP file upload script.
- Increased Log level: Increasing the Apache LogLevel to debug does not bring up any new information during request handling.
- Error does not occur with Perl: The problem does not occur with a different file upload script written in Perl. File upload works properly. So, it does not seem to be a problem with OS, Apache, Browser, ...
Remarks: This is my attempt to rephrase my locked/on-hold question https://unix.stackexchange.com/questions/301444/small-http-requests-get-truncated, which I cannot edit anymore.