1. Prepare the installation files
: Http://pecl.php.net/package/PDO_MYSQL
2. Installation
# tar zxf pdo_mysql-1.0.2.tgz
# CD pdo_mysql-1.0.2
#/usr/local/php/bin/phpize #生成configure等文件, if there are errors see below error action handling
#./configure--with-php-config=/usr/local/php/bin/php-config--with-pdo-mysql=/usr/local/mysql
#make #如果有错误看下面错误操作
#make Install
When you are done, look at the last line pdo_mysql.so the build path
# Vim/usr/local/php/lib/php.ini #每个的ini文件位置不同, add the path to pdo_mysql.so in the last line
Extension =/usr/local/php/lib/php/extensions/no-debug-zts-20131226/pdo_mysql.so
Restart Apache to see that the Pdo_mysql has been loaded successfully.
When you run/usr/local/php/bin/phpize, it appears:
Configuring for:
PHP Api version:20041225
Zend Module Api no:20060613
Zend Extension Api no:220060519
Cannot find autoconf. Please check your autoconf installation and the
$PHP _autoconf environment variable. Then, rerun the this script.
The solution is:
# CD/USR/SRC
# wget http://ftp.gnu.org/gnu/m4/m4-1.4.9.tar.gz
# TAR-ZVXF M4-1.4.9.tar.gz
# CD m4-1.4.9/
#./configure && make && make install
# CD: /
# wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.62.tar.gz
# TAR-ZVXF Autoconf-2.62.tar.gz
# CD autoconf-2.62/
#./configure && make && make install
A simpler approach.
# Yum Install M4
# yum Install autoconf
Make occurs when:
Make: * * * [Pdo_mysql.lo] Error 1
Solutions
This problem occurs because the file is required for MySQL header at compile time, and it does not find the location of the head file by default search. So to link the MySQL header file under the/usr/local/mysql/include/directory to/usr/local/include /In the directory:
Ln-s/usr/local/mysql/include/*/usr/local/include/
This article is from the "Home_tang" blog, make sure to keep this source http://yagetang.blog.51cto.com/1780698/1670251
Pdo_mysql extension Support in PHP