php编译错误

[root@red5srv php]# tar zxvf php-5.4.11.tar.gz

[root@red5srv php]# cd php-5.4.11

[root@red5srv php-5.4.11]# ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-apxs2=/usr/local/apache/bin/apxs --with-mysql=/data/mysql --with-libxml-dir=/usr/local/libxml2/ --with-png-dir=/usr/local/libpng/ --with-jpeg-dir=/usr/local/jpeg8/ --with-freetype-dir=/usr/local/freetype/ --with-gd=/usr/local/gd/ --with-zlib-dir=/usr/local/zlib/ --with-mcrypt=/usr/local/libmcrypt/ --with-mysqli=/data/mysql/bin/mysql_config --enable-soap --enable-mbstring=all --enable-sockets

[root@red5srv php-5.4.11]# make


/root/php/php-5.4.11/ext/gd/gd_ctx.c:153: 错误:‘gdIOCtx’ 没有名为 ‘data’ 的成员
make: *** [ext/gd/gd.lo] 错误 1

解决方法如下:

好像说这个错误算是php5.4的bug

[root@red5srv php-5.4.11]# vi /usr/local/gd/include/gd_io.h

typedef struct gdIOCtx
{
int (*getC) (struct gdIOCtx *);
int (*getBuf) (struct gdIOCtx *, void *, int);

void (*putC) (struct gdIOCtx *, int);
int (*putBuf) (struct gdIOCtx *, const void *, int);

/* seek must return 1 on SUCCESS, 0 on FAILURE. Unlike fseek! */
int (*seek) (struct gdIOCtx *, const int);

long (*tell) (struct gdIOCtx *);

void (*gd_free) (struct gdIOCtx *);
void (*data);
}
gdIOCtx;


[root@red5srv php-5.4.11]# cp php.ini-development /usr/local/php/etc/php.ini

[root@red5srv etc]# vi /usr/local/apache/conf/httpd.conf

AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType application/x-httpd-php .php .phtml


重启apache 发现apache起来了,但是php页面不能加载
查看日志报错如下

[Mon Sep 02 20:44:26.307685 2013] [mpm_event:notice] [pid 28619:tid 47071720532656] AH00489: Apache/2.4.3 (Unix) PHP/5.4.11 configur
ed -- resuming normal operations
[Mon Sep 02 20:44:26.307771 2013] [core:notice] [pid 28619:tid 47071720532656] AH00094: Command line: '/usr/local/apache/bin/httpd'


经百度发现是 加固时限制系统资源会导致此故障

解决方法
[root@red5srv logs]# vi /etc/security/limits.conf

# End of file
#* hard nofile 65536
#* soft nofile 65536

[root@red5srv logs]# /usr/local/apache/bin/apachectl restart

网页显示正常了,但是页面date出现这么一个警告,百度查后结果是发现从php5.3 ,当对使用date()等函数时,如果timezone设置不正确,在每一次调用时间函数时,都会产生E_NOTICE 或者 E_WARNING 信息。

解决方法是
修改php.ini。打开php.ini查找date.timezone 去掉前面的分号修改成为:date.timezone =PRC
g: phpinfo(): It is not safe to rely on the system's timezone settings. You

posted @ 2014-05-01 20:42  kingtigerhu  阅读(182)  评论(0)    收藏  举报