ionCube loader installation on macOS Big Sur

565 Views Asked by At

I downloaded the Loader Wizard from https://www.ioncube.com/loaders.php
There seem to be so many problems in the wizard:
Wizard

  1. The wizard detects that I'm using macOS x86-64, its okay
  2. I download the archive and it contains ioncube_loader_dar_x.x.so files for all php versions except 7.4 and 8.x
  3. I put the loader files to /usr/local/lib/php/pecl/20190902
  4. In /usr/local/etc/php/7.4/conf.d/00-ioncube.ini I have
    zend_extension = /usr/local/lib/php/pecl/20190902/ioncube_loader_mac_7.4.so
    But I don't have the loader file for php 7.4 in the downloaded archive. And in the archive there are ioncube_loader_DAR_x.x.so files not ioncube_loader_MAC_x.x.so
    What are the differences between dar and mac?

I manually downloaded macOS (64 bits) loader from official website (not from the link in the wizard) and there was 7.4 in the archive so I proceeded with the installation with this file. But now I have another problems with macOS security
I had issues with certs and followed this tutorial:
https://www.simplified.guide/macos/apache-php-homebrew-codesign

I signed my php7.4 and loader file with this commands:

codesign --sign "Yarik Nashivan" --force --keychain ~/Library/Keychains/login.keychain-db /usr/local/opt/[email protected]/lib/httpd/modules/libphp7.so  
codesign --sign "Yarik Nashivan" --force --keychain ~/Library/Keychains/login.keychain-db /usr/local/lib/php/pecl/20190902/ioncube_loader_mac_7.4.so  

But I still have an errors in apache logs:

Failed loading /usr/local/lib/php/pecl/20190902/ioncube_loader_mac_7.4.so: dlopen(/usr/local/lib/php/pecl/20190902/ioncube_loader_mac_7.4.so, 9): no suitable image found.
Did find: /usr/local/lib/php/pecl/20190902/ioncube_loader_mac_7.4.so: code signing blocked mmap() of '/usr/local/lib/php/pecl/20190902/ioncube_loader_mac_7.4.so'
/usr/local/lib/php/pecl/20190902/ioncube_loader_mac_7.4.so: stat() failed with errno=22
1

There are 1 best solutions below

0
nashyvan On

The problem was with default macOS apache2. I installed and configured httpd via homebrew and all works fine:

brew install httpd