Link to home
Start Free TrialLog in
Avatar of mBf
mBf

asked on

How to Disable Zlib entirely from PHP?

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
Avatar of minichicken
minichicken

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-
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.
Avatar of mBf

ASKER

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
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.
Avatar of mBf

ASKER

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
ASKER CERTIFIED SOLUTION
Avatar of hernst42
hernst42
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mBf

ASKER

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