pdo mysql.so不存在_lnmp之PDO_mysql.so

php和mysql是安装在不同的机器上。(centos7.0)

编译php时

./configure \

--with-mysql=mysqlnd  \

--with-mysqli=mysqlnd\

--with-pdo-mysql=mysqlnd

最后mysql的PDO好像没有加载上去。

解决办法:

1、进入源码包:php-5.5.32/ext/pdo_mysql

/usr/local/services/php/bin/phpize  #可以显示出对应号

./configure --with-php-config=/usr/local/services/php/bin/php-config

make && make install

这时就会在该目录下的modules下生成pdo_mysql.so

2、copy文件

cp modules/pdo_mysql.so  /usr/local/services/php-5.5.32/lib/php/extensions/no-debug-non-zts-20121212/

3、加入到php.ini文件

extension_dir = "/usr/local/services/php-5.5.32/lib/php/extensions/no-debug-non-zts-20121212/"

extension="pdo_mysql.so"

4、重启php-fpm即可生效。

==============================================

编译libiconv时出现如下错误./stdio.h:1010:1: error: ‘gets’ undeclared here (not in a function)

_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");

^

make[2]: *** [progname.o] Error 1

make[2]: Leaving directory `/root/libiconv-1.14_2/srclib'

make[1]: *** [all] Error 2

make[1]: Leaving directory `/root/libiconv-1.14_2/srclib'

make: *** [all] Error 2

解决方法:

cd libiconv-1.14/srclib

vim stdio.in.h

通过搜索,定位到_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");这一行,然后在这一行的前后加上条件编译即可,修改后的内容如下:#if defined(__GLIBC__) && !defined(__UCLIBC__) && !__GLIBC_PREREQ(2, 16)

_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");

#endif

然后再make && make install

============================================

php编译报错

/usr/bin/ld: ext/ldap/.libs/ldap.o: undefined reference to symbol 'ber_strdup'/usr/bin/ld: note: 'ber_strdup' is defined in DSO /lib64/liblber-2.4.so.2 so try adding it to the linker command line/lib64/liblber-2.4.so.2: could not read symbols: Invalid operationcollect2: error: ld returned 1 exit statusmake: *** [sapi/cli/php] Error 1

解决办法:

./configure后

编辑MakeFile

找到 开头是 'EXTRA_LIBS' 这一行 在结尾加上 '-llber' 然后执行 make && make install

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值