Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8126643
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T07:13:21+00:00 2026-06-06T07:13:21+00:00

We are running Apache 2.2.16 and PHP 5.3.3 with DomPDF to generate PDFs. After

  • 0

We are running Apache 2.2.16 and PHP 5.3.3 with DomPDF to generate PDFs. After generating a PDF, the subsequent request occasionally returns a plain text response consisting partially of the HTML used to generate the PDF (i.e. from the previous request), mixed with the HTTP headers and response of the requested page.

Apache is somehow mixing part of the response to the previous request with the new response. It seems like an output buffering issue, although I cannot replicate it locally using the same code. It also seems unrelated to gzip, as the problem still occurs with it disabled. I also tried in both Firefox and Chrome and experienced the same result.

UPDATE: If I turn keep-alive off, it solves the problem. However, I don’t necessarily want to leave keep-alive off. There is obviously still an underlying problem with the output buffer or response not being cleared.

Here are the request headers:

Request URL:https://asdf.com/checkout/5d86a9bdf455cdfd334494183559bf
Request Method:GET
Status Code:200 OK
Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Connection:keep-alive
Cookie:APP=636c8e6b58e991476ed7d38849bde0d4; _
Host:asdf.com
Referer:https://asdf.com/get_pdf/33711
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.34 Safari/536.11

And the truncated response shown in the browser:

<!-- truncated HTML from the previous page (i.e. PDF) -->
    </p>
</div>


</body>
</html>HTTP/1.1 200 OK
Date: Tue, 19 Jun 2012 18:06:13 GMT
Server: Apache
P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM"
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Length: 6457
Keep-Alive: timeout=7, max=96
Connection: Keep-Alive
Content-Type: text/html; charset=UTF-8

‹í]ksÛ¸’ýìü
ŒfvmׯzP/?µëØNâÄI<‘’ìL*å‚HHBD
Z–gæ¿o7@I-BNrkë~ÐÜ;c‰<xtŸF£›lŠÇ¿œ¿;ëüq}Aj’ëÏ®.ÏHa¯TúT=+•Î;çä_vÞ\‘J±L:’F1W\D4,•.ÞHa Ôø°TšL&ÅIµ(d¿Ôy_ºÃ¾*Ø8ý¸§¬–Å@…Ö“c=àÝ(Œâ“ÝTLke4h=Ù:V\…¬õ{"‹Éßä2RLR_ñ[FN}_$‘âQÿ¸d`€1E  v¾Ç¾%üö¤p& I¤ö:Ó1+ß|;)(v§J8ØñTÆL$ª··_ ¥ÖqìK>VDA“ù•ÞRs´@bé›ùÇ ýJïŠ}!ú!£c}1ÒÇJ!ïÆ¥¯ß&§¥J±™~,ŽxTüZÇ
<!-- followed by a bunch more gzipped gibberish -->
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T07:13:25+00:00Added an answer on June 6, 2026 at 7:13 am

    It sure sounds like a problem with the webserver, in part caused by the keep-alive connection. Possible remedies:

    • Send a Content-Length header with the PDF if you don’t already. Also, make sure the Content-Length is correct: i.e: there is no more output after that.
    • Disable KeepAlive in apache. Problem is this is cannot be done on a per-request or even per-directory basis as far as I know, so that would mean disabling if for you whole site (not recommended), or serve the pdf from a different virtual host.

    My preference definitely goes to the first option if that solves it, the second one is cumbersome.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a request handler running in apache/mod_php which occasionally expands beyond the maximum
I've been working on an internal site that has Apache / PHP running. I
I have php running on apache. I have downloaded what I think to be
Is there a way to set php running under apache to create folders with
I am running PHP 5.3.2, Apache 2.2.14 and xdebug 2.2.0rc1 on my Ubuntu 10.04
I'm running server on Mandriva 2011 Apache 2.2.22 PHP 5.3.14 PHPUnit Version 3.3.17 Selenium
I am running: Apache 2 PHP 5.3.3 CentOS And when I check pcre, I
I've came across on this problem, I have a sever running apache and php.
On RED HAT LINUX: Running APACHE From a PHP script I want to run
I am running Apache 2.3.16 with PHP 5.3.9. I also have a third party

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.