tags:

views:

37

answers:

1

I am on shared hosting, and I noticed the PHP does not include bzip2. It seems I would have to re-compile PHP inorder to use this. I don't think shared hosting allows this, so is there any alternative to my situation or bzip2?

+1  A: 

If your host allows dl() (I doubt it), you can dynamically load a shared extension.

Checklist for dl:

The best thing you can do is asking your host to enable bzip2 support, and otherwise search for an alternative. There are plenty hosts with bzip2 supported.

Lekensteyn
I AM IN LUCK! It is enabled. How do I get the extension though? Do I have to download it from somewhere?
Doug
What OS is your server running on? Win32 or Linux? Is the server running as module (Apache) or CGI? You can check that using `phpinfo()`, look for `System` and `Server API`.
Lekensteyn
System: Linux and Server API: CGI/FastCGI
Doug
Ok, and what distro is it? FreeBSD, Debian, CentOS, ...?
Lekensteyn
How do I check?
Doug
Just paste the full System line from phpinfo(). It should be noted there
Lekensteyn
Found it. I used `cat /proc/version`. Debian.
Doug
Debian 64 bits download: http://packages.debian.org/lenny/ia64/libbz2-1.0/download. Unpack it on your computer and upload `lib/libbz2.so.1` to `libbz2.so` on your server.
Lekensteyn
Unpacked, where do I upload it to? Is this right? `dl("libbz2.so.1"); dl("libbz2.so.0"); dl("libbz2.so.0.4");`
Doug
Oops, I missed this line: `This parameter is only the filename of the extension [...] The directory where the extension is loaded from depends on your platform`. Sorry for the confusion, but you really have to contact your hosting provider.
Lekensteyn
Okay. I'll do that.
Doug