1:pdo_mysql进入php安装是的解压目录
cd /usr/soft/php-5.5.37/ext/pdo_mysql/
运行phpize phpize是用来扩展php扩展模块的,通过phpize可以建立php的外挂模块
/usr/phpenv/php5.5.37/bin/phpize
configure模块
./configure --with-php-config=/usr/phpenv/php5.5.37/bin/php-config --with-pdo_mysql=/usr/phpenv/mysql5.6.30
make make install修改php.ini 添加extension=pdo_mysql.so
重启php
2:mysql和pdo_mysql的安装方法相同
3:mysqli
进入php安装是的解压目录
cd /usr/soft/php-5.5.37/ext/mysqli/
运行phpize phpize是用来扩展php扩展模块的,通过phpize可以建立php的外挂模块
/usr/phpenv/php5.5.37/bin/phpizeconfigure模块
./configure --with-php-config=/usr/phpenv/php5.5.37/bin/php-config --with-mysqli=/usr/phpenv/mysql5.6.30/bin/mysql_config
make
出错:
/usr/soft/php-5.5.37/ext/mysqli/mysqli_api.c:36:47: error: ext/mysqlnd/mysql_float_to_double.h: No such file or directory
make: *** [mysqli_api.lo] Error 1
解决办法:
cp ../../ext/mysqlnd/* ext/mysqlnd/
make成功ok
make install