首页  >  文章  >  后端开发  >  linux环境下配置PHP的mysql,mysqli,pdo扩展

linux环境下配置PHP的mysql,mysqli,pdo扩展

巴扎黑
巴扎黑原创
2016-11-10 09:42:571696浏览

一、安装mysql扩展 

Java代码  

cd php-5.6.14
cd ext/
cd mysql/
/usr/local/php/bin/phpize 
./configure --with-php-config=/usr/local/php/bin/php-config --with-mysql=mysqlnd --with-zlib-dir=/usr/local/zlib
make
make install

提示如下: 

Java代码  

Installing shared extensions:     /usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/

二、安装mysqli扩展 

Java代码  

cd php-5.6.14
cd ext/
cd mysqli/
/usr/local/php/bin/phpize 
./configure --with-php-config=/usr/local/php/bin/php-config --with-mysql=mysqlnd
make
make install

提示如下: 

Java代码  
Installing shared extensions:     /usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/  
Installing header files:          /usr/local/php/include/php/


三、安装pdo扩展 

Java代码  

cd php-5.6.14  
cd ext/  
cd pdo/  
/usr/local/php/bin/phpize   
./configure --with-php-config=/usr/local/php/bin/php-config --with-pdo-mysql=mysqlnd  
make  
make install

提示如下: 

Java代码  

Installing shared extensions:     /usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/  
Installing header files:          /usr/local/php/include/php/  
Installing PDO headers:          /usr/local/php/include/php/ext/pdo/


最后配置php.ini即可


声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn