6

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

denirun
  • 61
  • 3

1 Answers1

0

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.

Christopher Jones
  • 9,449
  • 3
  • 24
  • 48
  • Hi Christopher!, very glad that you answer. But it' not helps. I tried 19_8 basic + sdk, tried .dmg – but no luck. Installation of pecl oci8 is successfully, but on runtime get exception: `dyld: lazy symbol binding failed: Symbol not found: _OCIClientVersion`, Maybe problem with oci8 extension? Or some env. variables must be in profile? – denirun Jan 25 '21 at 09:15
  • Hi, still no solution. I put the [same case](https://bugs.php.net/bug.php?id=80846) in pecl bugs report... and still no help. @christopher-jones help us... how to deal with shared library under PHP + Apple Silicone. – denirun Apr 28 '21 at 08:50
  • I don't have access to M1 hardware – Christopher Jones Apr 28 '21 at 12:42
  • Users of various Instant Client tools on M1 with Rosetta have said they needed to use x86 application binaries to use the x86 Instant Client. – Christopher Jones Apr 12 '22 at 21:39