PHP Fatal error: Call to undefined function gzinflate()

The gzinflate() function is part of the zlib library in PHP, which provides support for gzip compression. If you are encountering a “Call to undefined function gzinflate()” error, it means that the zlib library is not enabled in your PHP installation. (fujifilm-x)

To resolve this issue, you need to install the zlib library and enable it in your PHP configuration. Here’s how you can do this on an Ubuntu system:

  1. Install the zlib1g-dev package:
    sudo apt-get update
    sudo apt-get install zlib1g-dev
  2. Re-compile and install PHP with the zlib library enabled:
    sudo apt-get install php7.2-dev
    sudo apt-get install php-pear
    sudo pecl install zlib
  3. Add the following line to your php.ini file:
    extension=zlib.so
  4. Restart the web server to apply the changes:
    sudo service apache2 restart

After these steps, the gzinflate() function should be available in your PHP installation, and the “Call to undefined function gzinflate()” error should be resolved.

Leave a Comment