报错一:
configure: error: Don't know how to define struct flock on this system, set --enable-opcache=no
报错二:
configure: error: off_t undefined; check your library configuration
问题:
需要libmysqlclient.so 文件,也就是mysql下的/lib/目录下的 libmysqlclient.so
解决方法:解决问题二 off_t 的报错。问题一报错中说了添加一个--enable-opcache=no就可以
[root@Centos6 lib]# vim /etc/ld.so.conf
添加如下:
/usr/local/mysql/lib (/usr/local/mysql是mysql的安装目录)
保存退出,执行ldconfig命令,如下:
[root@Centos6 lib]# ldconfig
然后运行 ./configure …… 我的configure如下:
(configure不一样不重要,重要的是报错是一样的。我是为后边装zabbix做准备)
./configure --prefix=/usr/local/php --with-gettext --with-mysqli=/usr/local/mysql/bin/mysql_config --with-mysql=/usr/local/mysql --with-iconv-dir=/usr/local/libiconv --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-fpm --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --enable-short-tags --enable-static --with-xsl --with-fpm-user=nginx --with-fpm-group=nginx --enable-ftp --enable-opcache=no
希望能帮到你!