Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Call to undefined function bzdecompress PHP

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!

like image 769
Sredny M Casanova Avatar asked Feb 06 '23 00:02

Sredny M Casanova


1 Answers

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
like image 65
hassan Avatar answered Feb 08 '23 14:02

hassan