7

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.

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

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!

Thanks

2 Answers 2

4

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!

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 :)

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.

1
  • To elaborate on this, I understand code signing is only part of the problem. Even if you do sign the code, with Catalina you'll end up with another issue (as described in superuser.com/a/1536442/1100783). Building PHP and the extension would solve the code signing issue. Jul 1, 2020 at 1:02
-3

I also have same problem. Everybody resolves the problem with homebrew...

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
2
  • Does that mean you still have the problem? If so follow my instructions and compile php, apache from source and it'll be ok.
    – Pooya Raki
    Feb 4, 2019 at 19:00
  • Sure, It's ready, but it does not solve the cause of file signature (the big problem) Feb 6, 2019 at 3:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.