Doug Crompton on 17 Sep 2010 11:27:38 -0700


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Apache2/PHP not displaying correctly


OK got it fixed. The apache2 php.ini file had the zlib output compression
set to on. I remember doing this but it had to be over a year ago. Why
this showed up now I don't know unless some other unknown setting got
changed and it interacted. The snippet from php.in is below.....

Thanks for your help

Doug

; You can redirect all of the output of your scripts to a function.  For
; example, if you set output_handler to "mb_output_handler", character
; encoding will be transparently converted to the specified encoding.
; Setting any output handler automatically turns on output buffering.
; Note: People who wrote portable scripts should not depend on this ini
;       directive. Instead, explicitly set the output handler using
ob_start().
;       Using this ini directive may cause problems unless you know what
script
;       is doing.
; Note: You cannot use both "mb_output_handler" with "ob_iconv_handler"
;       and you cannot use both "ob_gzhandler" and
"zlib.output_compression".
; Note: output_handler must be empty if this is set 'On' !!!!
;       Instead you must use zlib.output_handler.
;output_handler =

; Transparent output compression using the zlib library
; Valid values for this option are 'off', 'on', or a specific buffer size
; to be used for compression (default is 4KB)
; Note: Resulting chunk size may vary due to nature of compression. PHP
;       outputs chunks that are few hundreds bytes each as a result of
;       compression. If you prefer a larger chunk size for better
;       performance, enable output_buffering in addition.
; Note: You need to use zlib.output_handler instead of the standard
;       output_handler, or otherwise the output will be corrupted.
zlib.output_compression = off
;zlib.output_compression_level = -1

; You cannot specify additional output handlers if zlib.output_compression
; is activated here. This setting does the same as output_handler but in
; a different order.
;zlib.output_handler =




On Fri, 17 Sep 2010, Eric at Lucii.org wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Doug:
>
> That is it.  I saw binary characters so I saved it to blog.html.gz and then
> unzipped it.  It was gzipped html.
>
> Turn off compression in Apache - that should be an instant fix.
> Alternatively, look at the mime type headers.
>
> Also, sometimes a PHP package will generate the page already gzipped - and then
> apache gzips it too.
>
> Sorry I cannot be of more help right now but deadlines are looming over here.
> Actually that's a good thing... it means paychecks are looming shortly
> thereafter  :-)
>
> Eric
>
> On 09/17/2010 09:05 AM, Doug Crompton wrote:
> > Eric,
> >
> >   Thanks. I had though that might be the problem also but like you I don't
> > know what to do to fix it.
> >
> > Just to confirm...  you are also seeing the binary stuff when you look at
> > this URL ???
> >
> > http://chs-68.org/blog/
> >
> > Doug
> >
> > On Fri, 17 Sep 2010, Eric at Lucii.org wrote:
> >
> > Doug:
> >
> > I have a theory as to what the problem is but not why it's happening.
> >
> > You're seeing a gzip version of the page that is not being un-gziped.
> >
> > It is likely
> > EITHER
> >  - gzip compression without a proper header
> > OR
> >  - something on your server side is forcing a double gzip compression which the
> > browser only un-gzips once.
> >
> > To test my theory, load the page of binary "junk" and then save it as a file
> > like "index.html.gz"  Then, from the command line you gunzip it.  If the
> > resulting file is the html of the page you are expecting then it's confirmed.
> >
> > Hope that helps!
> >
> > Eric
> >
> > On 09/17/2010 06:19 AM, Doug Crompton wrote:
> >>>> The prior message was my attempt to enter into my reply an example of the
> >>>> garbage screen characters that are generated. If you can goto -
> >>>>
> >>>> http://chs-68.org/blog/
> >>>>
> >>>> and see what you get there. The characters are displayed look like what
> >>>> you would get if you displayed a binary file in an ascii editor. I have
> >>>> restarted apache numerous times. I have not rebooted the system. The logs
> >>>> have no unusual entries.
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>> On Fri, 17 Sep 2010, Ezra Wolfe wrote:
> >>>>
> >>>>> On Thu, Sep 16, 2010 at 8:57 PM, Doug Crompton <doug@crompton.com> wrote:
> >>>>>
> >>>>>> All of the sudden my served PHP pages are not displaying correctly. Using
> >>>>>> Apache2 and PHP5. This was all working and word press files were
> >>>>>> displaying fine. The only thing I have done that I know of is a Python
> >>>>>> upgrade.
> >>>>>>
> >>>>>> All I get is a screen full of random characters when trying to view PHP
> >>>>>> files. Tried firefox and explorer browsers.
> >>>>>>
> >>>>>> Any ideas of what to check for?
> >>>>>>
> >>>>>>
> >>>>> Have you tried restarting apache?
> >>>>>
> >>>>> To help with troubleshooting it would be good to post some specifics: Can
> >>>>> you check the error logs and post the output somewhere? Both
> >>>>> /var/log/apache2 and/or /var/log/syslog. If you don't have apache logging
> >>>>> turned on you can turn in on by editing /etc/apache2/httpd.conf or
> >>>>> apache2.conf depending on your distro. Look for the logging directive and
> >>>>> follow the directions to turn it on. Restart apache when you are done.
> >>>>>
> >>>>> Can you be specific about random characters?
> >>>>>
> >>>>
> >>>>
> >>>> ****************************
> >>>> *  Doug Crompton	   *
> >>>> *  Richboro, PA 18954	   *
> >>>> *  215-431-6307		   *
> >>>> *		  	   *
> >>>> * doug@crompton.com        *
> >>>> * http://www.crompton.com  *
> >>>> ****************************
> >>>>
> >>>>
> >>>> ___________________________________________________________________________
> >>>> Philadelphia Linux Users Group         --        http://www.phillylinux.org
> >>>> Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
> >>>> General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug
> >>>>
> >
> ___________________________________________________________________________
> Philadelphia Linux Users Group         --        http://www.phillylinux.org
> Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
> General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug
> >>
>
> > "Those that sacrifice essential liberty to obtain a little temporary safety
> >  deserve neither liberty nor safety."  -- Ben Franklin (1759)
>
> > ****************************
> > *  Doug Crompton	   *
> > *  Richboro, PA 18954	   *
> > *  215-431-6307		   *
> > *		  	   *
> > * doug@crompton.com        *
> > * http://www.crompton.com  *
> > ****************************
>
>
> > ___________________________________________________________________________
> > Philadelphia Linux Users Group         --        http://www.phillylinux.org
> > Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
> > General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug
>
>
> - --
> #  Eric Lucas
> #
> #                "Oh, I have slipped the surly bond of earth
> #                 And danced the skies on laughter-silvered wings...
> #                                        -- John Gillespie Magee Jr
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAkyTrFMACgkQ2sGpvXQrZ/7ExACgggkfyWq70XxUh/DUgQ213tkj
> 1BoAoLLXWEhdNlWfy3R8mHzaj4R0sT3F
> =iMZH
> -----END PGP SIGNATURE-----
> ___________________________________________________________________________
> Philadelphia Linux Users Group         --        http://www.phillylinux.org
> Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
> General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug
>


"Those that sacrifice essential liberty to obtain a little temporary safety
 deserve neither liberty nor safety."  -- Ben Franklin (1759)

****************************
*  Doug Crompton	   *
*  Richboro, PA 18954	   *
*  215-431-6307		   *
*		  	   *
* doug@crompton.com        *
* http://www.crompton.com  *
****************************


___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug