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

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

巴扎黑
Release: 2016-11-10 09:42:57
Original
1755 people have browsed it

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
Copy after login

The prompt is as follows:

Java code

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

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
Copy after login

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/
Copy after login


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
Copy after login

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/
Copy after login


Finally configure php.ini


Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template