PHP 7.4 configure error : Package requirements (zlib) were not met
When compiling php-7.4.6 on Linux, run the command
./configure --prefix=/opt/php-7.4.6 --with-pdo-mysql --enable-fpm --with-curl, but the following error occurs.
checking for zlib... no configure: error: Package requirements (zlib) were not met: No package 'zlib' found Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables ZLIB_CFLAGS and ZLIB_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.
On the web page https://pkgs.org/search/?q=zlib, find the
zlib-devel version that matches your operating system, and download and install it.
2. With command line
Ubuntu / Debian
sudo apt-get install zlib1g-dev
RHEL / CentOS
sudo yum install zlib-devel