-
There are two zip files on the Oracle website. Download them and unzip them into "/opt/oracle/instantclient_19_8". You will need to use "Grant Temporary Admin Rights" to create the folder.
-
Use homebrew and pecl to install the PHP extension
a. With homebrew installed, run "brew install php"
b. Run "pecl search oci8" to get the latest stable version. As of the writing of this, the latest stable release is 3.3.0
c. Run "pecl install oci8-X.X.X --with-oci8=instantclient,/opt/oracle/instantclient_19_8" (replacing X.X.X with the version number for the latest stable version). When it asked for the path to the ORACLE_HOME directory, give it "instantclient,/opt/oracle/instantclient_19_8". If this worked, the output should end in "Extension oci8 enabled in php.ini".
d. The result should be 'oci8.so' being installed. Make a note of where it ended up. It is in '/opt/homebrew/Cellar/php/8.3.8/pecl/20230831/oci8.so' in my case but it might be different for you.
-
Activate the extension by editing the 'php.ini' in '~/Library/Application Support/Herd/config/php/<version>/'.
a. If you click the Herd icon on the menu bar and then click "open configuration files", it should open the folder where you can do this.
b. Once you get to this folder, you can add the extension definition to each php.ini file (example: "extension=/opt/homebrew/Cellar/php/8.3.8/pecl/20230831/oci8.so"