Click to See Complete Forum and Search --> : Adding Modules
I am using a webserver with PHP4 that currently does not have the ZLIB module installed. I want to install it, but my webhost said that if I wanted it, I'd have to install myself. But I read somewhere else that to install additional modules you had to recompile php4 with them in there. Is this true? Or can you add them on somehow w/o having the recompile everything? I do appreciate your help.
Erik
tinuviel
05-01-2001, 08:06 AM
Erik,
If you are running on Linux then yes, you have to recompile. If the server is windows then all they have to do is make sure the ZLIB dll is on there server and simply uncomment that support in the php.ini file. None of which I think you can do as a customer...I'm not sure why they are telling you that.
mathieu
05-01-2001, 08:56 AM
Tinuviel is completely right, but as a reference:
You can compile some extensions as a shared library..
$ tar -xvzf php-4.0.x.tar.gz
$ cd php-4.0.x
$ ./configure --with-zlib=shared
$ cd ext/zlib
$ make
$ cp .libs/zlib.so ~/php_modules/
(Yes, usually a normal user can compile php like that in his home directory)
You can then load it with the dl() function
http://uk.php.net/dl
<?php
dl('zlib.so');
echo gz_compress('whatever');
/* well, you don't *REALLY* want to do that :-) */
?>
I had some problems with dl() not taking relative paths,
but I figure that's cos its some 4.0.5-dev version atm :)
Beware: this function is a huge performance killer.
Good luck!
-- Mathieu
I have tryed this under Windows NT with SNMP for use with the snmpget(); function, but I still get Undefined Fucntion.
What am I doing wrong?
PHP Builder
Copyright WebMediaBrands Inc. All Rights Reserved.