安装PDO_Mysql

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了安装PDO_Mysql相关的知识,希望对你有一定的参考价值。

在安装phpwind的时候显示没有安装PDO_mysql

网上搜的倒是很多,不过看起来好难的样子

这里把我的步骤贴出来做个笔记

[[email protected] ~]# wget http://pecl.php.net/get/PDO_MYSQL-1.0.2.tgz  #down一个源码包
[[email protected] ~]# tar zxfPDO_MYSQL-1.0.2.tgz
[[email protected] ~]# cd PDO_MYSQL-1.0.2
[[email protected] PDO_MYSQL-1.0.2]#/usr/local/php/bin/phpize   
Configuring for:
PHP Api Version:         20131106
Zend Module Api No:      20131226
Zend Extension Api No:   220131226
[[email protected] PDO_MYSQL-1.0.2]#
[[email protected] PDO_MYSQL-1.0.2]# ./configure--with-php-config=/usr/local/php/bin/php-config--with-pdo-mysql=/usr/local/mysql/
[[email protected] PDO_MYSQL-1.0.2]# ln -s/usr/local/mysql/include/* /usr/local/include/ #不这样或许会报错
[[email protected] PDO_MYSQL-1.0.2]# make&& make install

#完成的显示

PATH="$PATH:/sbin" ldconfig -n/root/PDO_MYSQL-1.0.2/modules

----------------------------------------------------------------------

Libraries have been installed in:

  /root/PDO_MYSQL-1.0.2/modules

 

If you ever happen to want to link againstinstalled libraries

in a given directory, LIBDIR, you musteither use libtool, and

specify the full pathname of the library,or use the `-LLIBDIR‘

flag during linking and do at least one ofthe following:

   -add LIBDIR to the `LD_LIBRARY_PATH‘ environment variable

    during execution

   -add LIBDIR to the `LD_RUN_PATH‘ environment variable

    during linking

   -use the `-Wl,--rpath -Wl,LIBDIR‘ linker flag

   -have your system administrator add LIBDIR to `/etc/ld.so.conf‘

 

See any operating system documentationabout shared libraries for

more information, such as the ld(1) andld.so(8) manual pages.

----------------------------------------------------------------------

 

Build complete.

Don‘t forget to run ‘make test‘.

 

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

修改php.ini

[[email protected] PDO_MYSQL-1.0.2]# vim/usr/local/php/php.ini
#修改下面的内容
extension_dir ="/usr/local/php/lib/php/extensions/no-debug-zts-20131226/"
extension=pdo_mysql.so

重启apache

/etc/init.d/apache2.4 restart


本文出自 “duwers” 博客,请务必保留此出处http://duwers.blog.51cto.com/7376225/1856309

以上是关于安装PDO_Mysql的主要内容,如果未能解决你的问题,请参考以下文章

增加pdo_mysql单独安装

安装PDO_Mysql

安装PHP之PDO_MYSQL扩展

php5.6安装PDO_MYSQL扩展

centos 6.5下编译安装php5.6,不支持pdo_mysql问题。

安装 PDO_MYSQL