4

I have an Ubuntu 16.04 server with PHP7 + nginx running. I already have a project in PHP Laravel 5.1 running in my local enviroment (Windows with Xampp) and everything is running great. I have a PHP script that uses the function bzdecompress of Bzip2 but then, in the server just crash and show this message:

Call to undefined function App\Http\Controllers\bzdecompress() 

I don't see instructions of how install this library (if needed) or how to load it or check at least that is loaded. Thank you very much!

Sredny M Casanova
  • 4,735
  • 21
  • 70
  • 115

1 Answers1

8

1) check your installed packages php -m

if bzip2 is installed move to step 3 directly , if not installed then install it by running :

2) for php7 :

apt-get install php7.0-bz2

for php5:

apt-get install php-bz2

3) then make sure that you've enabled your extension via :

phpenmod bz2

4) then you can restart your server

service nginx restart
hassan
  • 7,812
  • 2
  • 25
  • 36