如何编译和Mac OS莫哈韦使用PHP扩展

问题描述 投票:6回答:2

我刚安装了新的OSX莫哈韦和你也知道它带有只提供一些扩展安装PHP 7.1.19前。

首先,我不是自制软件或任何其他包管理器的粉丝,以及禁用安全utils的即csrutil。

我已经成功编译国际扩展,但Apache不加载它由于代码签名的问题:

PHP Startup: Unable to load dynamic library 'intl.so' - dlopen(intl.so, 0x0009): code signature in (intl.so) not valid for use in process: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed. in Unknown on line 0

有没有签署新编译的扩展,可能使用临时签名方法或什么办法?

我知道有很多关于这个问题,其他议题但都没有答案或者至多暗示自制一种解决方法!

谢谢

php macos apache macos-mojave
2个回答
4
投票

之后,好多天试图让intl与内置的PHP我结束了一个强大的解决方案的工作!

首先,我必须说,这个答案无关的代码签名!

这是我做了什么,我忽略了内置的包(PHP,Apache)的两者从源代码编译,现在我有最新版本都与国际扩展运行就像一个魅力安装,建设新的扩展是小菜一碟和PHP运行它们不唠叨:)

我真的不明白为什么人们使用homebrew这样的事情,而你可以很容易地编译库和扩展自己。

我希望这个答案可以帮助别人那里。


0
投票

我也有同样的问题。每个人都解决了自制的问题...

codesign -vd /usr/lib/php/extensions/no-debug-non-zts-20160303/x.so
/usr/lib/php/extensions/no-debug-non-zts-20160303/x.so: code object is not signed at all


codesign -vd /usr/lib/php/extensions/no-debug-non-zts-20160303/opcache.so 
Executable=/usr/lib/php/extensions/no-debug-non-zts-20160303/opcache.so
Identifier=com.apple.opcache
Format=Mach-O thin (x86_64)
CodeDirectory v=20100 size=2914 flags=0x0(none) hashes=87+2 location=embedded
Platform identifier=5
Signature size=4485
Info.plist=not bound
TeamIdentifier=not set
Sealed Resources=none
Internal requirements count=1 size=68


codesign -vd /usr/lib/php/extensions/no-debug-non-zts-20160303/xdebug.so 
Executable=/usr/lib/php/extensions/no-debug-non-zts-20160303/xdebug.so
Identifier=com.apple.xdebug
Format=Mach-O thin (x86_64)
CodeDirectory v=20100 size=1985 flags=0x0(none) hashes=58+2 location=embedded
Platform identifier=5
Signature size=4485
Info.plist=not bound
TeamIdentifier=not set
Sealed Resources=none
Internal requirements count=1 size=64
© www.soinside.com 2019 - 2024. All rights reserved.