[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How to Disable Zlib entirely from PHP?

Posted on 2004-11-06
7
Medium Priority
?
1,765 Views
Last Modified: 2013-12-13
Greetings,

My PHP is compiled as an apache module with configuration option "--with-zlib".
I need to disable Zlib entirely without recompiling PHP.
I have tried setting the directive "zlib.output_compression" to No in /etc/php.ini with no success.
I also tried uncommenting both "AddEncoding x-compress Z" and "AddEncoding x-gzip gz tgz" in /etc/httpd/conf/httpd.conf with no success also.

Any ideas?

Cheers,

--mBf
0
Comment
Question by:mBf
  • 3
  • 3
7 Comments
 
LVL 12

Expert Comment

by:minichicken
ID: 12516809
Just some ideas:

Did you also comment out this line: ;extension=php_zip.dll

and also after you've done the changes, did you restart apache? You will need to restart to take the new settings.

regards-
0
 
LVL 48

Expert Comment

by:hernst42
ID: 12517021
Hi mBf,
what's you problem with the zlib. If php is compiled with it, the zlib will be included/loaded as the libphp4.so is linked against that library.
To turn off output-compress seti the value to Off (not No)

There is no way to disable zlib without recompiling php aus --with-zlib was not compiled as shared/dynamic loadable extension.
0
 

Author Comment

by:mBf
ID: 12518173
minichicken, zlib is compiled in php and is not a loadable extension.

herns42, yes I have set output-compress to Off. I was just writing my question in a hurry.

I found out that I could not disable zlib without recompiling php.

an out of topic question, how can I unload an extention from /etc/php.ini?

Cheers,

mBf
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 48

Expert Comment

by:hernst42
ID: 12518263
You can not unload an build in extension of php without recompiling php.
You can only disable the loading of shared-extensuion if you have a line like extension=gd.so. If you remove that line, that module will no longer be present if php is loaded. If you don't have such a line you can not unload that extension.
0
 

Author Comment

by:mBf
ID: 12518588
What I need exactly is to disable the compression of php forums on the fly.
It appears that I can do that by disabling the function 'ob_gzhandler'.

Is there anyway?

Cheers,

--mBf
0
 
LVL 48

Accepted Solution

by:
hernst42 earned 200 total points
ID: 12518839
you can disable the function in your php by setting
disable_functions=ob_gzhandler
0
 

Author Comment

by:mBf
ID: 12520006
Thanks.

I made sure that "disable_functions" is the correct solution although I haven't tried it myself.
I'll be rewarding the points for you now.

Thanks again.

Cheers,

--mBf
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to dynamically set the form action using jQuery.
Suggested Courses
Course of the Month20 days, 13 hours left to enroll

865 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question