dyld: lazy symbol binding failed for php oic8 on Apple M1

Viewed 954

On Intel based MacOS my installation process of php-oci8 was fine. After I moved to the new architecture Apple M1, I got strange exception. And can’t understand how to resolve it.

Installation process:

brew install php

cd ~/Downloads

curl -O https://download.oracle.com/otn_software/mac/instantclient/198000/instantclient-basic-macos.x64-19.8.0.0.0dbru.dmg
curl -O https://download.oracle.com/otn_software/mac/instantclient/198000/instantclient-sdk-macos.x64-19.8.0.0.0dbru.dmg
curl -O https://download.oracle.com/otn_software/mac/instantclient/198000/instantclient-sqlplus-macos.x64-19.8.0.0.0dbru.dmg

hdiutil mount instantclient-basic-macos.x64-19.8.0.0.0dbru.dmg 
hdiutil mount instantclient-sdk-macos.x64-19.8.0.0.0dbru.dmg
hdiutil mount instantclient-sqlplus-macos.x64-19.8.0.0.0dbru.dmg

/Volumes/instantclient-basic-macos.x64-19.8.0.0.0dbru/install_ic.sh

hdiutil unmount /Volumes/instantclient-basic-macos.x64-19.8.0.0.0dbru
hdiutil unmount /Volumes/instantclient-sdk-macos.x64-19.8.0.0.0dbru
hdiutil unmount /Volumes/instantclient-sqlplus-macos.x64-19.8.0.0.0dbru

sudo mkdir -p /opt/oracle
sudo mv instantclient_19_8/ /opt/oracle

pecl install oci8

# Oracle Instant Client [autodetect] : instantclient,/opt/oracle/instantclient_19_8

Build process completed successfully
Installing '/opt/homebrew/Cellar/php/8.0.1_1/pecl/20200930/oci8.so'
install ok: channel://pecl.php.net/oci8-3.0.1
Extension oci8 enabled in php.ini

When I try to check, is oci8 loaded correctly, I receive next problem:

php -i
oci8

OCI8 Support => enabled
OCI8 DTrace Support => disabled
OCI8 Version => 3.0.1
dyld: lazy symbol binding failed: Symbol not found: _OCIClientVersion
  Referenced from: /opt/homebrew/lib/php/pecl/20200930/oci8.so
  Expected in: flat namespace

dyld: Symbol not found: _OCIClientVersion
  Referenced from: /opt/homebrew/lib/php/pecl/20200930/oci8.so
  Expected in: flat namespace

Abort trap: 6

Can some one help, how to deal with this problem?

MacOS: 11.1, Apple M1, PHP: 8.0.1, OCI8 Ext: 3.0.1, Oracle Instant Client: 19.8

UPD 1: Tested on latest Oracle Client v19.8 and v12.2, the problem in the same

UPD 2: Tested via .dmg and via .zip, the problem in the same

1 Answers

There is no native M1 binary for Oracle Instant Client and Rosetta hasn't been tested.

If you try anything, try the 19.8 Instant Client installed from the DMG packages. This was the first version notarized for recent macOS releases (see here). This version will connect to the same DB versions that the 12.2 client will. I don't know whether it will work on M1 machines.

Related