Home  >  Article  >  Backend Development  >  Configure PHP's mysql, mysqli, pdo extensions in Linux environment

Configure PHP's mysql, mysqli, pdo extensions in Linux environment

巴扎黑
巴扎黑Original
2016-11-10 09:42:571719browse

1. Install mysql extension

Java code

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

The prompt is as follows:

Java code

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

2. Install the mysqli extension

Java code

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

The prompt is as follows:

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


3. Install pdo The extension

Java code

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

tips are as follows:

Java code

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/


Finally configure php.ini


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn