env: CentOS 5.5 X86_64, Mysql 5.1.45 source, PHP 5.3.2
编译mysql并install后,接下来就是安装php.
采用root用户执行 php -v 显示正常。 当采用普通用户比如web运行php -v 时:
[web@MAWEB1 ~]$ php -v
php: error while loading shared libraries: libmysqlclient.so.16: cannot open shared object file: No such file or directory
# ln -s /usr/local/mysql/lib/mysql/libmysqlclient.so.16.0.0 /usr/lib64/libmysqlclient.so.16
[web@MAWEB1 ~]$ php -v
php: error while loading shared libraries: libmysqlclient.so.16: cannot open shared object file: Permission denied
# rm -f /usr/lib64/libmysqlclient.so.16
# cp /usr/local/mysql/lib/mysql/libmysqlclient.so.16.0.0 /usr/lib64/libmysqlclient.so.16
[web@MAWEB1 ~]$ php -v
PHP 5.3.2 (cli) (built: Aug 2 2010 22:50:55)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
now everything is ok.
阅读(1488) | 评论(0) | 转发(0) |