yum安裝php編譯拓展
阿新 • • 發佈:2018-12-21
1.安裝mcrypt拓展
1.1 yum安裝依賴包
yum install libmcrypt libmcrypt-devel mcrypt mhash
1.2 下載mcrypt的tar包
wget http://pecl.php.net/get/mcrypt-1.0.1.tgz
tar xf mcrypt-1.0.1.tgz
cd mcrypt-1.0.1
1.3 編譯安裝 mcrypt
phpize
./configure --with-php-config=/usr/bin/php-config
make && make install
1.4 在php.ini加上擴充套件 重啟
extension=mcrypt.so #儲存
systemctl restart php-fpm
2.安裝imagick拓展
2.1安裝 ImageMagick
wget http://www.imagemagick.org/download/ImageMagick.tar.gz #下載
tar xf ImageMagick.tar.gz
cd ImageMagick-7.0.8-15
./configure --prefix=/usr/local/imagemagick
make -j 4 && make install
2.2 安裝 imagick
wget http://pecl.php.net/get/imagick-3.4.3.tgz
tar xf imagick-3.4.3.tgz
cd imagick-3.4.3
phpize
./configure --with-php-config=/usr/bin/php-config --with-imagick=/usr/local/imagemagick/
make -j 4 && make install
echo $?
vim /etc/php.ini
extension=imagick.so
systemctl restart php-fpm
3. msgpack
wget https://pecl.php.net/get/msgpack-2.0.2.tgz
tar xvf msgpack-2.0.2.tgz
cd msgpack-2.0.2/
phpize
./configure --with-php-config=/usr/bin/php-config
make && make install
vim /etc/php.ini
extension=msgpack.so
systemctl restart php-fpm
4. php-redis
4.1 下載tar包 解壓
wget https://codeload.github.com/phpredis/phpredis/zip/develop
unzip develop
cd phpredis-develop
#yum -y install php-devel #安裝phpize模組
phpize
./configure --with-php-config=/usr/bin/php-config
make -j 4 && make install
vim /etc/php.ini
extension=redis.so
systemctl restart php-fpm
5 yaf安裝
wget http://pecl.php.net/get/yaf-3.0.7.tgz
tar xf yaf-3.0.7.tgz
cd yaf-3.0.7.tgz
phpize
./configure --with-php-config=/usr/bin/php-config
make && make install
vim /etc/php.ini
extension=yaf.so
5.1 yaf在php.ini中的配置
[yaf]
yaf.environ="product"
yaf.library="/Users/mac/cloud/php/phplib"
yaf.cache_con_config=0
yaf.name_suffix=0
yaf.name_separator="_"
yaf.st_compatible=1
yaf.action_prefer=1
yaf.forward_limit=5
yaf.lowcase_path=1
yaf.use_namespace=0
yaf.use_spl_autoload=1
6. xdebug安裝
6.1 獲取 解壓
wget http://www.xdebug.org/files/xdebug-2.3.3.tgz
tar zxvf xdebug-2.3.3.tgz
cd xdebug-2.3.3
6.2 編譯安裝
phpize
./configure --enable-xdebug --with-php-config=/usr/bin/php-config
make -j 8 && make install
6.3 在php.ini新增xdebug模組
vim /etc/php.ini
extension=xdebug.so
6.4 在php.ini新增配置資訊
[Xdebug]
xdebug.remote_enable = 1 //開啟遠端除錯
xdebug.remote_host = 172.17.73.130 //遠端ip地址抑或是本機地址
xdebug.remote_port = 9001 //遠端IDE伺服器監聽埠
xdebug.remote_handler=DBGP //使用的協議