Home >Backend Development >PHP Problem >How to install bzip2 in php

How to install bzip2 in php

藏色散人
藏色散人Original
2020-09-11 09:11:483081browse

How to install bzip2 in php: first install the system bzip2 development library that the extension depends on; then compile and install the "ext/bz2" extension in the php source code package directory; and finally modify the "php.ini" configuration file.

How to install bzip2 in php

Recommended: "PHP Video Tutorial"

php installation bzip2

Install the system bzip2 development library that the extension depends on

sudo yum install bzip2-devel

Compile and install the ext/bz2 extension in the php source code 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 an extension directory like this

/usr/local/php/lib/php/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

Then you can enable the bzip2 extension

How to install bzip2 in php

The above is the detailed content of How to install bzip2 in php. For more information, please follow other related articles on the PHP Chinese website!

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