phpbzip2

How to enable bzip2 support in PHP 7


I have an application that needs bzip2 support. I have installed the library, but I can't figure out how to enable it. By default it's disable in PHP.

I have searched the internet the whole day, but I can't get it to work. I am running on Debian 8 (Jeezy) and PHP 7. Any help is appreciated!


Solution

  • According to the PHP manual, the bzip2 extension is not enabled by default (as you stated)

    Bzip2 support in PHP is not enabled by default. You will need to use the --with-bz2[=DIR] configuration option when compiling PHP to enable bzip2 support.

    See here

    According to this quote you'll have to compile PHP by yourself in order to enable bzip2 support. Surely there are plenty of resources on the net on how to compile PHP (e.g. here). Anyway, compiling it by yourself may not be suitable for a beginner like you are. You can surely give it a shot (you'll learn a lot), but it'll be way easier, if you have access to some kind of Linux expert.