Home >Backend Development >PHP Problem >How to install bzip2 in php
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.
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
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!