Heim  >  Artikel  >  Backend-Entwicklung  >  linux环境下配置PHP的mysql,mysqli,pdo扩展

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

巴扎黑
巴扎黑Original
2016-11-10 09:42:571652Durchsuche

一、安装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即可


Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn
Vorheriger Artikel:为什么高手离不开Linux系统?Nächster Artikel:php BOM 问题