Maison >développement back-end >tutoriel php >linux环境下配置PHP的mysql,mysqli,pdo扩展
一、安装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即可