Home  >  Article  >  Backend Development  >  How to enable bzip2 compression in php? Building a server environment

How to enable bzip2 compression in php? Building a server environment

PHP中文网
PHP中文网Original
2016-08-18 09:15:471327browse

How to enable bzip2 compression of php? When setting up a server environment

How to enable bzip2 compression in php? Building a server environment

Reply content;

I found that my local development environment did not open this extension, so I tried it and it worked. I will share the steps as follows

Installation of extension dependencies System bzip2 development library

sudo yum install bzip2-devel

Compile and install the ext/bz2 extension in the php source package directory

cd ~/php-5.6.21/ext/bz2
phpize
./configure --with-php-config=/usr/local/php/bin/php-config
sudo make && sudo make install

If successful, there will be a bz2.so file in /usr/local/php/lib/php in a similar extension directory /extensions/no-debug-non-zts-20131226/

Modify the php.ini configuration file

sudo vim /usr/local/php/lib/php.ini


Add an extension
extension=bz2.so
After saving, restart php-fpm

and then You can enable bzip2 extension

How to enable bzip2 compression in php? Building a server environment

The above is how to enable bzip2 compression of php? Regarding the content of building a server environment, please pay attention to the PHP Chinese website (www.php.cn) for more related content!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn