I downloaded and installed Oracle InstantClient from https://www.oracle.com/database/technologies/instant-client/macos-intel-x86-downloads.html, and installed it via the Instructions for OS X Monterey.
I then ran arch -arm64e pecl install oci8-3.2.1
for the proper version of oci8
to use with php 8.1 & Silicon, it reports that it has installed the oci8
extension and adds the so
file.
However, when I run php -a
, the first thing that pops up is that it can't find the oci8.so
:
tried: /opt/homebrew/lib/php/pecl/20210902/oci8.so
(dlopen(/opt/homebrew/lib/php/pecl/20210902/oci8.so, 0x0009):
symbol not found in flat namespace (_OCIAttrGet))
The oci8.so
file exists at that location - I've tried reinstalling both php 8.1 and the oci extension, but still get the same error. Thx for any help!
Sorted it out. For future reference: all pieces of the puzzle (Oracle, brew, php, oci8) need to be specifically set for Intel:
Download the Oracle InstantClient dmg(s) for OS X (Intel) and install per the documentation on the Oracle download page, then:
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
arch -x86_64 /usr/local/Homebrew/bin/brew [re]install php@8.1
$PATH
oci8
: arch -x86_64 pecl install oci8-3.2.1
instantclient,[/full/path/to/installed/instantclient/directory]
when promptedextension=oci8.so
to php.ini
if not automatically added after the PECL
install, and extension_dir
as neededphp -a
will return function_exists('oci_connect')
as true
Note that the above installs the InstantClient for the cli only - you'll need additional configuration if you want to run a server using the Intel PHP; that info is in the output from the php install step.