PHP Fatal error: Call to undefined function gzinflate()
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: 10.218.105.1, server: newsletter.cyberciti.biz, request: “GET /a/ HTTP/1.0”, upstream: “fastcgi://127.0.0.1:9000”, host: “server1.cyberciti.biz”
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
OR
# apk add php7-zlib
You must restart php-fpm or apache/lighttpd process:
# rc-service php-fpm restart
OR
# /etc/init.d/php-fpm restart
Install php56-zlib on FreeBSD
Type the following command:
# pkg install php56-zlib
OR
# pkg install php70-zlib
Make sure you restart the php-fpm:
# service php-fpm restart