PHP Fatal Error: Call to Undefined Function gzinflate() – How to Fix
The error Fatal error: Call to undefined function gzinflate() (along with gzdecode() or gzuncompress()) means PHP was built or installed without the zlib extension. It most often shows up when moving a site onto a minimal VPS, FreeBSD server, or custom Docker image.

Checking whether the module is loaded takes one command, and enabling it usually takes just a couple of minutes.
Step 1. Verify If zlib Is Loaded
Check PHP’s active modules from the command line:
php -m | grep -i zlib
If nothing comes back, the extension is missing or disabled. Keep in mind that PHP CLI and your web server handler (PHP-FPM or Apache) can use different php.ini files, so double-check phpinfo() in the browser too if CLI shows it loaded.
Step 2. Install or Enable zlib
- FreeBSD: install the matching extension package for your PHP version (for example PHP 8.3):
pkg install php83-zlib
(If you compile PHP from ports, make sure [X] ZLIB support is ticked in the build options.)
- Debian / Ubuntu: official Debian/Ubuntu PHP packages normally compile
zlibin by default. If you hit this on a custom build, make sure the system libraryzlib1gis installed:
sudo apt update && sudo apt install zlib1g
- Windows (XAMPP / WAMP / standalone PHP): modern Windows PHP binaries include
zlibbuilt in – checkdisable_functionsinphp.inito make suregzinflatewasn’t explicitly blocked. - Docker (official PHP images):
zlibis built into base images, while archive features usingzipalso requirezlib1g-devanddocker-php-ext-install zip.
Step 3. Restart PHP-FPM or Apache
Reload your PHP handler so running workers pick up the newly installed module:
sudo systemctl restart php8.3-fpm # or service php-fpm restart / service apache24 reload
On shared hosting without SSH access, open your control panel (cPanel / DirectAdmin -> Select PHP Version -> Extensions) and toggle zlib on, or ask support to enable it.