Author Topic: PHP-FPM Won't install zlib says missing dependency zlib-dir  (Read 539 times)

anandmys and 6 Guests are viewing this topic.

Offline
*
PHP-FPM Won't install zlib says missing dependency zlib-dir
« on: August 16, 2026, 06:51:18 PM »
When trying to compile PHP 8.4.x PHP FPM custom selector throws error saying "zlib-dir" is a dependency of zlib which in 8.4.x zlib-dir or zlib-develop is baked into PHP version 8.4.x to my knowledge. This missing dependency doesn't allow PHP-FPM to be compiled with custom settings because of the missing zlib-dir dependency.

From what I can tell from research is that zlib-dir is no longer needed in PHP8.4.x and should not be throwing the error. Compiling without zlib does not allow gzip page compression, so this is a deal breaker.

Offline
***
Re: PHP-FPM Won't install zlib says missing dependency zlib-dir
« Reply #1 on: August 16, 2026, 09:32:39 PM »
Zlib support in PHP just is not enabled by default.
If you want use it, you will need to configure PHP --with-zlib[=DIR], it's a requirement.
See: https://www.php.net/manual/en/zlib.installation.php

So, check if your compilation is enabling zlib in config.log, if that file have --with-zlib parameter:
# grep zlib /path/to/your/configure/config.log

Regards,
Netino

Offline
*****
Re: PHP-FPM Won't install zlib says missing dependency zlib-dir
« Reply #2 on: August 16, 2026, 11:20:07 PM »
I think CWP posted the fix for this.

But with everyone starting new threads in all different areas, about the same PHP issues, it's hard to keep track anymore.

You'll have to look thru the past couple days of posts about PHP, CWP side banner to the left is hard to miss.

Offline
**
Re: PHP-FPM Won't install zlib says missing dependency zlib-dir
« Reply #3 on: August 17, 2026, 10:19:48 AM »
I think CWP posted the fix for this.

But with everyone starting new threads in all different areas, about the same PHP issues, it's hard to keep track anymore.

You'll have to look thru the past couple days of posts about PHP, CWP side banner to the left is hard to miss.
I don't think so.

Has anyone found a solid solution yet? I think we need to use the advanced options on "Managing options" and use this:

[zlib]
default=1
option="--with-zlib"
info-file=zlib.txt

Offline
**
Re: PHP-FPM Won't install zlib says missing dependency zlib-dir
« Reply #4 on: August 17, 2026, 12:37:04 PM »
Mmm I found a fix that worked for me, it's an odd one though...

In the below 2 files all the " are coded as " I used a text editor to find/replace " to " rebooted server and was then able to install php 8.5 via PHP version switcher on my Alma8 server. Previously i was getting the zlib grumble.

/usr/local/cwpsrv/htdocs/resources/conf/el8/php_switcher/8.5.ini
/usr/local/cwpsrv/htdocs/resources/conf/el8/php_selector/8.5.ini

phpinfo()
PHP Version => 8.5.9
« Last Edit: August 17, 2026, 01:05:22 PM by 6Sense »
Web Design, Development & Web Hosting
https://6sense.com.au

Offline
***
Re: PHP-FPM Won't install zlib says missing dependency zlib-dir
« Reply #5 on: Today at 05:19:44 AM »
If you are trying to compile php-fpm84/5, simply click "Manage Options" next to php-8.4, then "Advanced Options" (Simple Editor), and change the settings. It appears the zlib compilation option has already been fixed:
Code: [Select]
[zlib]
default=1
option="--with-zlib=/usr"
info-file=zlib.txt
include=zlib-dir

What hasn't been fixed is the PHP Switcher, which lacks "Advanced Options/Simple Editor" for compilation settings. Consequently, it still has the issue of requiring compilation with zlib.