off_t undefined

今天帮朋友搭建lnmp环境的时候,在编译php-5.6.30的时候,报以下这个错误
off_t undefined_第1张图片

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等相关的模块

后来报错就没有了,完美解决这个问题
off_t undefined_第2张图片

备注:
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;”打开就可以了,具体我也没有尝试,因为我习惯用源码编译安装。

你可能感兴趣的:(web服务)