off_t undefined

来源:互联网 发布:mpacc研究生生活知乎 编辑:程序博客网 时间:2024/05/24 01:24

今天帮朋友搭建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

后来我将编译参数改为:

./configure --prefix=/usr/local/php \--with-config-file-path=/usr/local/php/etc \--enable-fpm \--with-fpm-user=www \--with-fpm-group=www \--disable-debug \--with-curl \--with-iconv \--with-pcre-regex \--with-zlib \--enable-bcmath \--enable-ftp \--enable-sockets \--enable-mbstring \--enable-mbregex \--with-gd \--with-jpeg-dir \--enable-soap \--with-mcrypt \--with-xsl \--enable-zip \--with-openssl \--enable-opcache=no \--with-mysqli=/usr/local/mysql/bin/mysql_config \--with-mysql-sock=/usr/local/mysql/mysql.sock \--with-pdo-mysql=/usr/local/mysql \--disable-fileinfo

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

备注:
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 -v

其实我感觉解决问题,还是需要我们多去尝试和突破
3、再用yum安装nginx,在启动过程中有一下错误:

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

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

原创粉丝点击