checking for known struct flock definition... configure: error: Don't know how to define struct flock on this system, set --enable-opcache=

时间:2021-12-29 03:54:33

在对php进行安装的过程中出现如下错误:

1、报错信息:

1
checking for known struct flock definition... configure: error: Don't know how to define struct flock on this system, set --enable-opcache=no
 

2、解决办法:

1
2
3
4
vim /etc/ld.so.conf.d/local.conf     # 编辑库文件
/usr/local/lib                       # 添加该行
:wq                                  # 保存退出
ldconfig -v                          # 使之生效

3、注意事项:

这里添加的库文件路径一定要和你系统平台arch一致,32bit的系统直接添加/usr/local/lib即可,64bit系统要填加/usr/local/lib64.否则依旧会报错,我当时就是添加了/usr/local/lib死活编辑不了,后来更改为

/usr/local/lib64才可以。切记