php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #80846 oci8 extension can't detect instance client under M1
Submitted: 2021-03-08 10:01 UTC Modified: -
Votes:28
Avg. Score:4.9 ± 0.4
Reproduced:24 of 24 (100.0%)
Same Version:16 (66.7%)
Same OS:24 (100.0%)
From: denirun at gmail dot com Assigned:
Status: Open Package: OCI8 related
PHP Version: 8.0.3 OS: macOS BigSur 11.2.2, M1
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: denirun at gmail dot com
New email:
PHP Version: OS:

 

 [2021-03-08 10:01 UTC] denirun at gmail dot com
Description:
------------
Problem exists under Apple M1 chip only!

After set–up Oracle Instant Client under M1, and run sqlplus to check, does instant client works – the sqlplus works without any problems. All connection, and some simple sqls works perfectly. 

Than after set up oci8 extension via pecl, and provide path to instant client – the script don't find any errors, and installation finished with success.

After check how extension loaded, PHP stops with critical exception:
dyld: lazy symbol binding failed: Symbol not found: _OCIClientVersion
 


Test script:
---------------
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

php -i | grep oci8

Expected result:
----------------
oci8
oci8.connection_class => no value => no value
oci8.default_prefetch => 100 => 100
oci8.events => Off => Off
oci8.max_persistent => -1 => -1
oci8.old_oci_close_semantics => Off => Off
oci8.persistent_timeout => -1 => -1
oci8.ping_interval => 60 => 60
oci8.privileged_connect => Off => Off
oci8.statement_cache_size => 20 => 20

Actual result:
--------------
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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-04-26 13:09 UTC] ramongnr2009 at hotmail dot com
same problem here,

I've done this process too and it doesn't solve:

https://github.com/oracle/node-oracledb/issues/149#issuecomment-165678929
 [2021-04-26 13:42 UTC] ramongnr2009 at hotmail dot com
I tested on versions 8 and 7 (7.3, 7.4)
 [2022-01-22 19:45 UTC] AntonioRM81 at Gmail dot com
Same problem here… we need help :( is this problem eclusive to Instant Client not being ported to ARM M1 yet? Is there nothing we can do to workaround?
 [2022-08-18 12:54 UTC] roubin_d at yahoo dot com
SOLVED!!

Hint: 
1. Run terminal using Rosetta
2. Install everything (i.e httpd, php, curl etc..) under rosetta terminal using brew (arch -x86_64) not the brew for m1 silicon
3. Download instantclient files & extract & create symlinks (https://gist.github.com/nasrulhazim/308c9f59a2ddba364b4b908ee9238265)
4, Run pecl install oci8
5. Enjoy

Note: of course there are more steps to it but above are the main points to follow - most important always use the homebrew intel version (i.e. arch -x86_64)
 [2023-11-01 14:50 UTC] leonardoandognini at gmail dot com
To solve this problem I created a docker environment that works on Apple Silicon, information on how to use it is in this repository

https://github.com/leonardoandognini/oci8-php-development-setup
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Oct 04 17:01:27 2024 UTC