SitePoint Sponsor

User Tag List

Results 1 to 11 of 11
  1. #1
    Zero Point Zero Siebird's Avatar
    Join Date
    Feb 2007
    Location
    York, PA
    Posts
    456
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to disable zlib support?

    How can I disable zlib support? I viewed my php.ini file and didn't see anywhere to disable. Anyone know how to do this?

    This is the only area I saw a mention of zlib within the file (lines 148-177):
    Code:
    ; 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 =

  2. #2
    Twitter: @AnthonySterling silver trophy AnthonySterling's Avatar
    Join Date
    Apr 2008
    Location
    North-East, UK.
    Posts
    6,111
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    disable_functions string
    This directive allows you to disable certain functions for security reasons. It takes on a comma-delimited list of function names. disable_functions is not affected by Safe Mode. This directive must be set in php.ini For example, you cannot set this in httpd.conf.
    I guess, disable_functions = ob_gzhandler in the ini would do it.
    @AnthonySterling: I'm a PHP developer, a consultant for oopnorth.com and the organiser of @phpne, a PHP User Group covering the North-East of England.

  3. #3
    Zero Point Zero Siebird's Avatar
    Join Date
    Feb 2007
    Location
    York, PA
    Posts
    456
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by SilverBulletUK View Post
    I guess, disable_functions = ob_gzhandler in the ini would do it.
    Restarted Apache and still says it's enabled

  4. #4
    SitePoint Evangelist
    Join Date
    Jun 2006
    Location
    Wigan, Lancashire. UK
    Posts
    523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Siebird View Post
    Restarted Apache and still says it's enabled
    But is it actually usable within a script?
    ---
    Development Projects:
    PHPExcel
    PHPPowerPoint

  5. #5
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2008
    Posts
    5,757
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    on unix, you could compile without it
    http://www.php.net/manual/en/zlib.installation.php

    keep in mind there's still stuff like ini_set() and the stream wrappers
    http://www.php.net/manual/en/wrappers.compression.php

  6. #6
    Zero Point Zero Siebird's Avatar
    Join Date
    Feb 2007
    Location
    York, PA
    Posts
    456
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Mark Baker View Post
    But is it actually usable within a script?
    Used "disable_functions = ob_gzhandler" and tried running the script with no success. I want to use TinyMCE w/gZIP compression, docs say it wont work with zlib enabled. Makes no sense because on my local environment with MAMP, it say zLib is enabled, but gZip compression is working???

    Quote Originally Posted by crmalibu View Post
    on unix, you could compile without it
    http://www.php.net/manual/en/zlib.installation.php

    keep in mind there's still stuff like ini_set() and the stream wrappers
    http://www.php.net/manual/en/wrappers.compression.php
    This mean I need to reinstall PHP? Have no clue how to do that and don't want to mess up the server.

    Thought this would be an easy on/off swith

  7. #7
    SitePoint Wizard
    Join Date
    Mar 2008
    Posts
    1,149
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Zlib is compiled statically right into the PHP binary, so you will have to re-compile PHP without zlib. There is no way around that.

  8. #8
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    I kind of find it funny that in order for TinyMCE to use Gzip it needs to turn off Zlib which has the Gzip functionality...
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  9. #9
    SitePoint Enthusiast
    Join Date
    Aug 2009
    Posts
    75
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is this on a server that you control? Maybe this is an Apache configuration issue.

  10. #10
    SitePoint Enthusiast premiumscripts's Avatar
    Join Date
    Aug 2009
    Location
    PremiumScripts.com
    Posts
    55
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try zlib.output_compression = 0
    PREMIUM PHP SCRIPTS - Sign up now to receive a big discount!

  11. #11
    Zero Point Zero Siebird's Avatar
    Join Date
    Feb 2007
    Location
    York, PA
    Posts
    456
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by logic_earth View Post
    I kind of find it funny that in order for TinyMCE to use Gzip it needs to turn off Zlib which has the Gzip functionality...
    Yeah makes no sense!

    Quote Originally Posted by kronso View Post
    Is this on a server that you control? Maybe this is an Apache configuration issue.
    Yeah, I'm on a (mt) DV 3.5

    Quote Originally Posted by premiumscripts View Post
    Try zlib.output_compression = 0
    I'll give that a shot. Tech. Support said "zlib.output_compression = Off" should be "off". Im just getting back around to this and will let everyone know. Thanks for the help!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •