PHP Fatal error: Call to undefined function gzinflate()

See all PHP related FAQ
I have a php script and whenever I run it, I get the following error message in my log file:
     2017/02/05 23:25:46 [error] 9696#9696: *10 FastCGI sent in stderr: “PHP message: PHP Fatal error: Call to undefined function gzinflate() in /home/xxxx/http/includes/functions.php(1) : eval()’d code on line 1″ while reading response header from upstream, client:, server:, request: “GET /a/ HTTP/1.0”, upstream: “fastcgi://”, host: “”
How do I fix this problem on Alpine Linux or Unix operating systems?

You need to use Zlib. The Zlib support in PHP is not enabled by default. You will need to configure PHP –with-zlib[=DIR]. The Windows version of PHP has built-in support for this extension. You do not need to load any additional extensions in order to use these functions. However, on Linux or Unix you need to install php5-zlib or php7-zlib as per your distro.

Install php5-zlib or php7-zlib on Alpine Linux

# apk add php5-zlib
# apk add php7-zlib
You must restart php-fpm or apache/lighttpd process:
# rc-service php-fpm restart
# /etc/init.d/php-fpm restart

Install php56-zlib on FreeBSD

Type the following command:
# pkg install php56-zlib
# pkg install php70-zlib
Make sure you restart the php-fpm:
# service php-fpm restart

🥺 Was this helpful? Please add a comment to show your appreciation or feedback.

nixCrat Tux Pixel Penguin
Hi! 🤠
I'm Vivek Gite, and I write about Linux, macOS, Unix, IT, programming, infosec, and open source. Subscribe to my RSS feed or email newsletter for updates.

2 comments… add one

Leave a Reply

Your email address will not be published. Required fields are marked *

Use HTML <pre>...</pre> for code samples. Your comment will appear only after approval by the site admin.