FreeBSD11+PHP7.1 无法编译安装

编译时提示错误

/root/src/php/swoole/swoole.c:1274:31: error: use of undeclared identifier 'SIOCGIFHWADDR'
            if (!(ioctl(sock, SIOCGIFHWADDR, (char *) &buf[i])))
                              ^
/root/src/php/swoole/swoole.c:1277:48: error: no member named 'ifr_hwaddr' in 'struct ifreq'
                        (unsigned char) buf[i].ifr_hwaddr.sa_data[0],
                                        ~~~~~~ ^
/root/src/php/swoole/swoole.c:1278:48: error: no member named 'ifr_hwaddr' in 'struct ifreq'
                        (unsigned char) buf[i].ifr_hwaddr.sa_data[1],
                                        ~~~~~~ ^
/root/src/php/swoole/swoole.c:1279:48: error: no member named 'ifr_hwaddr' in 'struct ifreq'
                        (unsigned char) buf[i].ifr_hwaddr.sa_data[2],
                                        ~~~~~~ ^
/root/src/php/swoole/swoole.c:1280:48: error: no member named 'ifr_hwaddr' in 'struct ifreq'
                        (unsigned char) buf[i].ifr_hwaddr.sa_data[3],
                                        ~~~~~~ ^
/root/src/php/swoole/swoole.c:1281:48: error: no member named 'ifr_hwaddr' in 'struct ifreq'
                        (unsigned char) buf[i].ifr_hwaddr.sa_data[4],
                                        ~~~~~~ ^
/root/src/php/swoole/swoole.c:1282:48: error: no member named 'ifr_hwaddr' in 'struct ifreq'
                        (unsigned char) buf[i].ifr_hwaddr.sa_data[5]);
2017-08-31 15:57
0
1

韩天峰 - 关注外星人

赞同来自: ucando

请修改源码去掉 swoole_get_local_mac 相关的代码。

https://github.com/swoole/swoole-src/commit/9eaaf1382c7578933dac3fad143033d1bd8c085f

2017-08-31 17:42
0

ucando

赞同来自:

编译可以进行, 不过又遇到新的错误, 请问怎么处理?

/root/src/php/swoole-src/src/network/Port.c:712:41: error: invalid operands to binary expression ('time_t' (aka 'long') and 'char ()(int, int)') if (date_format && mktime(&tm3) - timezone >= file_mtime) ~~~~~~~~~~~~ ^ ~~~~~~~~

2017-09-01 21:44
0

bevin1984 - phper

赞同来自:

我先碰到的是,找不到 pcre.h

做了一下 ln 之后就碰到楼主上面那样的问题了。

2017-09-12 16:09
0

bleakwind - 纯属路过...

赞同来自:

freebsd用ports或者pkg安装, 不要自己编译...

2017-09-18 16:55
0

韩天峰 - 关注外星人

赞同来自:

使用 Github 最新的 1.9 分支代码。已对 FreeBSD 问题进行了兼容处理。

2017-09-19 16:49

要回复问题请先登录注册