如何在Mac OS Mojave上编译和使用php扩展 [英] How to compile and use php extensions on Mac OS Mojave

查看:283
本文介绍了如何在Mac OS Mojave上编译和使用php扩展的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚安装了新的OSX Mojave,并且您知道它预装有PHP 7.1.19,仅提供少量扩展.

I have just installed the new OSX Mojave and as you know it comes with PHP 7.1.19 pre installed with just few extensions available.

首先,我不喜欢自制软件或任何其他程序包管理器,也不喜欢禁用安全实用程序,即csrutil.

First of all, I am not a fan of homebrew or any other package managers as well as disabling security utils i.e. csrutil.

我已经成功编译了intl扩展名,但是由于代码签名问题,apache无法加载它:

I have successfully compiled intl extension but apache doesn't load it due to a code signing problem:

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

是否有可能使用临时签名方法或其他方法来对新编译的扩展进行签名?

Is there a way to sign the newly compiled extensions, probably using ad-hoc signing method or something?

我知道关于此问题还有很多其他话题,但是所有这些话题都没有得到解答,或者最多只是提出了自制的变通办法!

I know there are lots of other topics about this issue but all are left unanswered or at most suggesting homebrew kind of workarounds!

谢谢

推荐答案

经过几天又几天的尝试,使intl与内置php一起工作,我最终得到了一个可靠的解决方案!

After days and days trying to get intl to work with the built-in php I ended up with a robust solution!

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

First I must say that this answer has nothing to do with code signing!

这是我做的事情,我忽略了内置软件包(php,apache),并从源代码进行了编译,现在我安装了最新版本的intl扩展程序,它们像魅力一样运行,构建新的扩展程序是小菜一碟和php运行它们而不会na:)

Here is what I have done, I ignored the built-in package( php, apache ) and compiled both from source and now I have the latest version of both installed with intl extension running like a charm, building new extensions is a piece of cake and php runs them without nagging :)

我真的不明白为什么人们会使用homebrew这样的东西,而您却可以轻松地自己编译库和扩展.

I don't really understand why people use homebrew for such a thing while you can easily compile libraries and extensions yourself.

我希望这个答案可以帮助某个人.

I hope this answer helps someone out there.

这篇关于如何在Mac OS Mojave上编译和使用php扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆