curl
1:安装curl
cd /usr/local
wget http://curl.haxx.se/download/curl-7.44.0.tar.gz
tar zxf curl-7.44.0.tar.gz
mv curl-7.44.0.tar.gz curl
cd curl
./configure
make
make install
2:安装PHP curl拓展
cd /usr/local/php/ext/curl
phpize
./configure --with-php-config=/usr/local/php/bin/php-config --with-curl=/usr/local/curl
make
make install
3:修改php.ini文件,开启curl拓展
vim /usr/local/php/lib/php.ini
extension=curl.so
4:重启php-fpm
ps -ef | grep php
kill -USR2 ID
pdo
cd /usr/local/php/ext/pdo_mysql
phpize
#如果提示Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF environment variable. Then, rerun this script. 解决:
yum install autoconf
#注意路径指向的是自己的mysql安装路径
./configure --with-php-config=/usr/local/php/bin/php-config --with-pdo-mysql=/usr/local/mysql
make
make install
vim /usr/local/php/lib/php.ini
#打开extension=pdo_mysql的注释
extension=pdo_mysql
#重启php-fpm
ps -ef | grep php 找到master的进程ID,kill,启动 /etc/init.d/php-fpm
#phpinfo看到pdo_mysql就完成了
PHP7 的 Mongodb 扩展
下载源码包
cd /usr/local/src
wget http://pecl.php.net/get/mongodb-1.7.4.tgz
tar -xf mongodb-1.7.4.tgz
mv mongodb-1.7.4.tgz mongodb
编译三部曲
# 进入源码目录
cd mongodb
# 通过 phpize 建立 PHP 的外挂模块,生成 configure
/usr/local/php/bin/phpize
# 配置
./configure --with-php-config=/usr/local/php/bin/php-config
# 配置安装 && 编译安装
make && make install
配置 php.ini
打开配置文件php.ini
vim /usr/local/php/lib/php.ini
添加
[mongodb]
extension = mongodb.so
退出保存
重启:php-fpm、nginx
查看:php -v
|