off_t undefined

今天帮朋友搭建lnmp环境的时候,在编译php-5.6.30的时候,报以下这个错误
这里写图片描述

configure: off_t undefined; check your library configuration

备注:linux 的操作系统是centos6.8(2.6.32-642.13.1.el6.x86_64)
lnmp环境搭建可以参考我的博文:http://blog.csdn.net/m0_37886429/article/details/68941918

刚开始php的编译参数是:

./configure  --prefix=/usr/local/php \
--with-config-file-path=/usr/local/php/etc \
--enable-fpm \
--with-fpm-user=www \
--with-fpm-group=www \
--with-mysql=/usr/local/mysql \
--with-mysqli=/usr/local/mysql/bin/mysql_config \
--with-mysql-sock=/usr/local/mysql/mysql.sock \
--with-pdo-mysql=/usr/local/mysql \
--with-iconv-dir \
--with-freetype-dir \
--with-jpeg-dir \
--with-png-dir \
--with-zlib \
--with-libxml-dir=/usr \
--enable-xml \
--disable-rpath \
--enable-bcmath \
--enable-shmop \
--enable-sysvsem \
--enable-inline-optimization \
--with-curl \
--enable-mbregex \
--enable-mbstring \
--with-mcrypt \
--enable-ftp \
--with-gd \
--enable-gd-native-ttf \
--with-openssl \
--with-mhash \
--enable-pcntl \
--enable-sockets \
--with-xmlrpc \
--enable-zip \
--enable-soap \
--with-gettext --disable-fileinfo \
--enable-opcache=no \
--enable-intl \
--with-xsl

根据报错可以看出,是库文件配置错误,说明是缺少相应的库文件,因此我们需要安装相应的库

linux安装库文件:http://blog.csdn.net/m0_37886429/article/details/78855165
#libevent,libiconv,libmcrypt等相关的模块

后来报错就没有了,完美解决这个问题
这里写图片描述

备注:
1、在编译的时候加上 –disable-fileinfo这个参数是因为,假如内存不足1G的时候,会报以下错误

make: *** [ext/fileinfo/libmagic/apprentice.lo] Error 1

加上这个参数就可以避免了
2、我在网上也看一种方法来解决“off_t undefined”,但是最终多没有生效,例如:

echo '/usr/local/lib64
/usr/local/lib
/usr/lib
/usr/lib64'>>/etc/ld.so.conf && ldconfig

3、再用yum安装nginx,在启动过程中有一下错误:

Starting nginx: nginx: [emerg] socket() [::]:80 failed (97: Address family not supported by protocol)
                                                           [FAILED]

这个问题,我在网上看了下,说是把这个参数“listen [::]:80 ipv6only=on default_server;”打开就可以了,具体我也没有尝试,因为我习惯用源码编译安装。

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值