1、重新编译php
添加--with-pdo-mysql=/usr/local/mysql指定MySQL的安装目录
编译时会报:
/home/oldboy/tools/php-5.3.27/sapi/cli/php: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory
make: *** [ext/phar/phar.php] 错误 127
报错:
解决1:
[[email protected] php-5.3.27]# find / -name "libmysqlclient.so.18"
/home/oldboy/tools/mysql-5.5.32-linux2.6-x86_64/lib/libmysqlclient.so.18
/application/mysql-5.5.32/lib/libmysqlclient.so.18
[[email protected] php-5.3.27]# echo "/usr/local/lib" >>/etc/ld.so.conf
[[email protected] php-5.3.27]# echo "/application/mysql-5.5.32/lib" >>/etc/ld.so.conf
[[email protected] php-5.3.27]# tail -1 /etc/ld.so.conf
/application/mysql-5.5.32/lib
[[email protected] php-5.3.27]# ldconfig
2、在php.ini配置文件添加参数
session.save_path = "/var/lib/php/session"
需要创建目录/var/lib/php/session。
命令为:
mkdir -p /var/lib/php/session
需要修改目录 "/var/lib/php/session" 的权限。
命令为:
chmod o=rwx -R /var/lib/php/session
原文地址:http://blog.51cto.com/14036860/2329098