1、PDO_MySQL make: *** [pdo_mysql.lo] Error 1
成都创新互联主要从事网站设计制作、成都网站设计、网页设计、企业做网站、公司建网站等业务。立足成都服务温县,10年网站建设经验,价格优惠、服务专业,欢迎来电咨询建站服务:13518219792
编译安装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了
3、CentOS 5.5下编译php时的一些典型错误及解决办法
http://www.linuxidc.com/Linux/2011-01/31115.htm
4、CentOs 编译php 遇到的一些问题
http://www.cnblogs.com/kristain/articles/3809243.html
5、php 5.3.9 源码编译安装如何启动 php-fpm?
我安装的是 PHP 5.3.9,并且使用如下配置安装:
./configure --prefix=/usr/local/php --enable-fpm
但是使用 /usr/local/php/sbin/php-fpm 却无法启动,提示错误:
ERROR: failed to load configuration file '/usr/local/php/etc/php-fpm.conf'
ERROR: FPM initialization failed
解决方法:
cd /usr/local/php/etc/
mv php-fpm.conf.default php-fpm.conf
6、PEAR package PHP_Archive not installed: generated phar will require PHP’s phar extension be enabled.
解决方案
这说明没有安装PEAR,解决方案有两种:
1、./configure时附加–without-pear
2、从http://pear.php.net/go-pear下列未打包的pear安装包并执行,步骤如下:
wget http://pear.php.net/go-pear.phar
php go-pear.phar
注意如果升级了autoconf到2.59编译7.0.0-dev的话–without-pear可能没有效果,建议执行后者方案
PHP编译问题:http://www.3lian.com/edu/2015/05-29/217560.html