码迷,mamicode.com
首页 > Web开发 > 详细

PHP编译问题汇总

时间:2015-05-15 15:49:06      阅读:142      评论:0      收藏:0      [点我收藏+]

标签:software   expected   included   error   before   

1PDO_MYSQL make: *** [pdo_mysql.lo] Error 1

编译安装PDO_MYSQL拓展模块,总是提示:

In file included from/data0/software/PDO_MYSQL-1.0.2/pdo_mysql.c:31:

/data0/software/PDO_MYSQL-1.0.2/php_pdo_mysql_int.h:25:19:error: mysql.h: No such file or directory

In file included from/data0/software/PDO_MYSQL-1.0.2/pdo_mysql.c:31:

/data0/software/PDO_MYSQL-1.0.2/php_pdo_mysql_int.h:36:error: expected specifier-qualifier-list before ‘MYSQL’

/data0/software/PDO_MYSQL-1.0.2/php_pdo_mysql_int.h:48:error: expected specifier-qualifier-list before ‘MYSQL_FIELD’

/data0/software/PDO_MYSQL-1.0.2/php_pdo_mysql_int.h:53:error: expected specifier-qualifier-list before ‘MYSQL_RES’

make: *** [pdo_mysql.lo] Error 1

这是因为这是因为在编译时需要 MySQL 的头的文件。而它按默认搜索找不到头文件的位置,所以才出现这个问题。通过软连接把MySQL头文件对应到/usr/local/include/下就好

比如你的MySQL安装文件位于/usr/local/mysql,那么就执行以下命令:

# ln -s /usr/local/mysql/include/* /usr/local/include/

PHP配置文件php.ini中添加扩展时要使用绝对路径

extension="/usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/pdo_mysql.so"

2、在搭建phpadmin的时候系统session_start()错误

错误信息:

Warning: session_start():open(/var/lib/php/session/sess_qavhhacl7lrdbggauasf1qdlo5, O_RDWR) failed: Nosuch file or directory (2) in /www/tool/classes/service/User.php on line75
Warning: Unknown: open(/var/lib/php/session/sess_qavhhacl7lrdbggauasf1qdlo5,O_RDWR) failed: No such file or directory (2) in Unknown on line 0
Warning: Unknown: Failed to write session data (files). Please verify that thecurrent setting of session.save_path is correct (/var/lib/php/session) inUnknown on line 0

 

查看php.ini:

session.save_path = "/var/lib/php/session" //session的存放路径

所以上面的文字是提示没有该目录

 

解决问题:

创建上面的目录

mkdir session

chmod -R 777 session

再次运行程序就OK了

 


PHP编译问题汇总

标签:software   expected   included   error   before   

原文地址:http://881955.blog.51cto.com/871955/1651595

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!