从源码手动编译 PHP 时出现如下错误:

 
 
 
 
 
Default
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
:
:
o
:
o
:
o
:
o
:
o
x86_64
)
1

 

解决办法

MakeFile 里面找到类似下面这一行:

 
 
 
 
 
Default
 
1
lcrypto

删除所有的 -lssl 和 -lcrypto 然后添加 libssl.dylib 和 libcrypto.dylib 的路径(如果你安装了 brew,那么则是 /usr/local/opt/openssl/lib/),重新运行 make 命令,done。

附上我修改后的 MakeFile EXTRA_LIBS 那一行:

 
 
 
 
 
Default
 
1
dylib

 

The Makefile has a line with EXTRA_LIBS, something like:

EXTRA_LIBS = -lresolv -lmcrypt -lltdl -liconv-lm -lxml2 -lcurl -lssl -lcrypto

Remove all occurrences of -lssl and -lcrypto and add the full path to libssl.dylib and libcrypto.dylib (brew links openssl to /usr/local/opt/openssl/lib/)

EXTRA_LIBS = -lresolv -lmcrypt /usr/local/opt/openssl/lib/libssl.dylib /usr/local/opt/openssl/lib/libcrypto.dylib -lltdl -liconv-lm -lxml2 -lcurl
 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-07-20
  • 2022-12-23
  • 2021-03-29
  • 2021-05-23
  • 2021-05-20
  • 2021-06-09
猜你喜欢
  • 2021-06-03
  • 2021-06-23
  • 2021-06-24
  • 2021-06-09
  • 2022-12-23
  • 2022-02-21
  • 2022-12-23
相关资源
相似解决方案