Linux, FreeBSD, Juniper, Cisco / Network security articles and troubleshooting guides

FAQ
It is currently Sun Oct 20, 2019 1:13 pm


Username:
Subject:
Message body:
Enter your message here, it may contain no more than 60000 characters. 

Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :arrow: :| :mrgreen: :geek: :ugeek:
Font size:
 
Font colour
Options:
BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON
Disable BBCode
Disable smilies
Do not automatically parse URLs
Confirmation code
Confirmation code:
In an effort to prevent automatic submissions, we require that you enter both of the words displayed into the text field underneath.
     

Topic review - PHP Fatal error: Call to undefined function gzencode() - missing zlib support
Author Message
Post subject: PHP Fatal error: Call to undefined function gzencode() - missing zlib support  |  Post Posted: Sat Jan 17, 2015 5:14 pm
With a PHP-FPM deployment, there are two levels of compression: in php and in nginx.
Nginx comes with gzip support in all flavors of Linux. The above error occurs when php is built from source without zlib support.

Here is how to configure php zlib extension separately assuming you still have the source:

Code:
root@server:/usr/src/php-5.6.4/ext/zlib# /opt/php-5.6.4/bin/phpize
Cannot find config.m4.
Make sure that you run '/opt/php-5.6.4/bin/phpize' in the top level source directory of the module

root@server:/usr/src/php-5.6.4/ext/zlib# cp -rp config0.m4 config.m4
root@server:/usr/src/php-5.6.4/ext/zlib# /opt/php-5.6.4/bin/phpize
Configuring for:
PHP Api Version:         20131106
Zend Module Api No:      20131226
Zend Extension Api No:   220131226

root@server:/usr/src/php-5.6.4/ext/zlib# ./configure --with-php-config=/opt/php-5.6.4/bin/php-config 

root@server:/usr/src/php-5.6.4/ext/zlib# make && make install
/bin/bash /usr/src/php-5.6.4/ext/zlib/libtool --mode=install cp ./zlib.la /usr/src/php-5.6.4/ext/zlib/modules
cp ./.libs/zlib.so /usr/src/php-5.6.4/ext/zlib/modules/zlib.so
cp ./.libs/zlib.lai /usr/src/php-5.6.4/ext/zlib/modules/zlib.la
PATH="$PATH:/sbin" ldconfig -n /usr/src/php-5.6.4/ext/zlib/modules
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/src/php-5.6.4/ext/zlib/modules

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,--rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------

Build complete.
Don't forget to run 'make test'.

Installing shared extensions:     /opt/php-5.6.4/lib/php/extensions/no-debug-non-zts-20131226/

Zlib is now built a shared extension for PHP (can be enabled and disabled).
Next open "php.ini" and add the following line in the "Dynamic Extensions" section and restart php:
Code:
extension=zlib.so

Let's confirm using cli php:
Code:
root@server:/usr/src/php-5.6.4/ext/zlib# /opt/php/bin/php -i | grep -i "zlib sup"
ZLib Support => enabled
Jump to:  
News News Site map Site map SitemapIndex SitemapIndex RSS Feed RSS Feed Channel list Channel list


Delete all board cookies | The team | All times are UTC - 5 hours [ DST ]



phpBB SEO