Forked from krisanalfa/macosx-install-php-oracle-oci8-pdo_oci.md
Last active
March 7, 2016 18:32
Revisions
-
jakofranko revised this gist
Mar 7, 2016 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -91,7 +91,7 @@ extension=oci8.so Restart your HTTP Server and test. ## Installing `pdo_oci` Execute the following commands: @@ -107,7 +107,7 @@ cd PDO_OCI-1.0 After that, download this patch and apply: ``` wget https://gist.githubusercontent.com/jakofranko/09c640a84e1411fc8aa1/raw/bf0334dde1b9af90e8090940ce0589948a55ad36/config.m4.patch patch config.m4 < config.m4.patch ``` @@ -122,7 +122,7 @@ We should tell our configuration to use `11.2.0.4` version, so it will find the ``` phpize ./configure --with-pdo-oci=instantclient,/Library/Oracle/instantclient_11_2,11.2.0.4 ``` Build it and install it: -
jakofranko revised this gist
Mar 7, 2016 . 1 changed file with 9 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,7 +11,7 @@ Download the following files from [Oracle website](http://www.oracle.com/technet * [instantclient-sqlplus-macos.x64-11.2.0.4.0.zip](http://www.oracle.com/technetwork/topics/intel-macsoft-096467.html) * [instantclient-sdk-macos.x64-11.2.0.4.0.zip](http://www.oracle.com/technetwork/topics/intel-macsoft-096467.html) Create and unzip all theses files into a the directory `/Library/Oracle/instantclient_11_2/`. This directory will looks like: ``` @@ -59,7 +59,7 @@ I recommand to install Oracle Server with a VirtualBox [VM preinstalled](http:// sudo /usr/local/bin/sqlplus oracle/[email protected] ``` ## Install OCI8 with pecl ```sh sudo pecl install oci8-2.0.10 # phpv5.2 - phpv5.6 @@ -70,7 +70,7 @@ sudo pecl install oci8 # phpv7 If the script prompt you to provide the path to ORACLE_HOME directory, respond with: ``` instantclient,/Library/Oracle/instantclient_11_2 ``` > Note: If you got PECL error: @@ -91,12 +91,14 @@ extension=oci8.so Restart your HTTP Server and test. ## Installing `pdo_oci`. Execute the following commands: ``` mkdir -p /Library/Oracle/instantclient_11_2/client ln -sf /Library/Oracle/instantclient_11_2/sdk/include /Library/Oracle/instantclient_11_2/client/ cd ~/Downloads pecl download pdo_oci tar -xvf PDO_OCI-1.0.tgz cd PDO_OCI-1.0 -
krisanalfa revised this gist
Mar 6, 2016 . 1 changed file with 14 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -61,8 +61,10 @@ sudo /usr/local/bin/sqlplus oracle/[email protected] ## Install extension with pecl ```sh sudo pecl install oci8-2.0.10 # phpv5.2 - phpv5.6 sudo pecl install oci8 # phpv7 ``` If the script prompt you to provide the path to ORACLE_HOME directory, respond with: @@ -71,6 +73,16 @@ If the script prompt you to provide the path to ORACLE_HOME directory, respond w instantclient,/usr/local/lib ``` > Note: If you got PECL error: ```sh touch $(brew --prefix php52)/lib/php/.lock && chmod 0644 $(brew --prefix php52)/lib/php/.lock # phpv5.2 touch $(brew --prefix php56)/lib/php/.lock && chmod 0644 $(brew --prefix php56)/lib/php/.lock # phpv5.6 touch $(brew --prefix php70)/lib/php/.lock && chmod 0644 $(brew --prefix php70)/lib/php/.lock # phpv7 ``` And your are done, normally pecl will automatically load the extension in your `php.ini`. If not, add the following line to your `php.ini`: ``` -
krisanalfa revised this gist
Nov 30, 2015 . 1 changed file with 7 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -97,6 +97,13 @@ wget https://gist.githubusercontent.com/krisanalfa/e0beaa512b4677c51a7c/raw/214c patch config.m4 < config.m4.patch ``` Also, we need to patch `pdo_oci.c` file: ``` wget https://gist.githubusercontent.com/krisanalfa/1bb09ad8f9147937bbeb/raw/b66ee62e8f4601a0f669e40a619881734787d4cd/pdo_oci.c.patch patch pdo_oci.c < pdo_oci.c.patch ``` We should tell our configuration to use `11.2.0.4` version, so it will find the right version in our system. ``` -
krisanalfa revised this gist
Oct 5, 2015 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -100,6 +100,7 @@ patch config.m4 < config.m4.patch We should tell our configuration to use `11.2.0.4` version, so it will find the right version in our system. ``` phpize ./configure --with-pdo-oci=instantclient,/usr/local/lib,11.2.0.4 ``` -
krisanalfa renamed this gist
Oct 2, 2015 . 1 changed file with 40 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ # Installation This procedure is tested on Mac OS X 10.10.5 with Developpers tools installed (xCode). PHP 5.6 installed with Homebrew. @@ -78,3 +78,42 @@ extension=oci8.so ``` Restart your HTTP Server and test. To installing `pdo_oci`. You must do following command: ``` mkdir -p /usr/local/lib/oracle/11.2.0.4/client ln -sf /usr/local/instantclient/11.2.0.4/sdk/include /usr/local/lib/oracle/11.2.0.4/client/ cd /tmp pecl download pdo_oci tar -xvf PDO_OCI-1.0.tgz cd PDO_OCI-1.0 ``` After that, download this patch and apply: ``` wget https://gist.githubusercontent.com/krisanalfa/e0beaa512b4677c51a7c/raw/214c36a65685c9c24102ad7b703d040a7fb60243/config.m4.patch patch config.m4 < config.m4.patch ``` We should tell our configuration to use `11.2.0.4` version, so it will find the right version in our system. ``` ./configure --with-pdo-oci=instantclient,/usr/local/lib,11.2.0.4 ``` Build it and install it: ``` make make install ``` After this open your `php.ini` and add this line: ``` extension=pdo_oci.so ``` Test it! -
krisanalfa revised this gist
Oct 1, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ # Installation This procedure is tested on Mac OS X 10.8 with Developpers tools installed (xCode). PHP 5.6 installed with Homebrew. ## Preparation -
krisanalfa revised this gist
Jun 17, 2014 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -44,10 +44,10 @@ This directory will looks like: ## Create symlinks ``` sudo ln -s /usr/local/instantclient/11.2.0.4/sdk/include/*.h /usr/local/include/ sudo ln -s /usr/local/instantclient/11.2.0.4/sqlplus /usr/local/bin/ sudo ln -s /usr/local/instantclient/11.2.0.4/*.dylib /usr/local/lib/ sudo ln -s /usr/local/instantclient/11.2.0.4/*.dylib.11.1 /usr/local/lib/ sudo ln -s /usr/local/lib/libclntsh.dylib.11.1 /usr/local/lib/libclntsh.dylib ``` -
krisanalfa revised this gist
Jun 17, 2014 . 1 changed file with 15 additions and 19 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,19 +3,15 @@ This procedure is tested on Mac OS X 10.8 with Developpers tools installed (xCod PHP 5.4 installed with Homebrew. ## Preparation Download the following files from [Oracle website](http://www.oracle.com/technetwork/topics/intel-macsoft-096467.html) (yes, you need to create an account and accept terms): * [instantclient-basic-macos.x64-11.2.0.4.0.zip](http://www.oracle.com/technetwork/topics/intel-macsoft-096467.html) * [instantclient-sqlplus-macos.x64-11.2.0.4.0.zip](http://www.oracle.com/technetwork/topics/intel-macsoft-096467.html) * [instantclient-sdk-macos.x64-11.2.0.4.0.zip](http://www.oracle.com/technetwork/topics/intel-macsoft-096467.html) Create and unzip all theses files into a the directory `/usr/local/instantclient/11.2.0.4/`. This directory will looks like: ``` @@ -47,38 +43,38 @@ This directory will looks like: ## Create symlinks ``` sudo ln -s /usr/local/instantclient/11.2.0.3/sdk/include/*.h /usr/local/include/ sudo ln -s /usr/local/instantclient/11.2.0.3/sqlplus /usr/local/bin/ sudo ln -s /usr/local/instantclient/11.2.0.3/*.dylib /usr/local/lib/ sudo ln -s /usr/local/instantclient/11.2.0.3/*.dylib.11.1 /usr/local/lib/ sudo ln -s /usr/local/lib/libclntsh.dylib.11.1 /usr/local/lib/libclntsh.dylib ``` ## Test with sqlplus instantclient I recommand to install Oracle Server with a VirtualBox [VM preinstalled](http://tech.lds.org/wiki/Oracle_VM). ``` sudo /usr/local/bin/sqlplus oracle/[email protected] ``` ## Install extension with pecl ``` sudo pecl install oci8 ``` If the script prompt you to provide the path to ORACLE_HOME directory, respond with: ``` instantclient,/usr/local/lib ``` And your are done, normally pecl will automatically load the extension in your `php.ini`. If not, add the following line to your `php.ini`: ``` extension=oci8.so ``` Restart your HTTP Server and test. -
gido revised this gist
Apr 2, 2013 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,6 +3,8 @@ This procedure is tested on Mac OS X 10.8 with Developpers tools installed (xCod PHP 5.4 installed with Homebrew. **Update**: I wrote a [blog post about this](http://antistatique.net/blog/2013/03/25/install-php-oracle-oci-extension-11-2-on-mac-os-x-10-8/). ## Preparation Download the following files from [Oracle website](http://www.oracle.com/technetwork/topics/intel-macsoft-096467.html) (yes, you need to create an account and accept terms): -
gido revised this gist
Mar 25, 2013 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -53,10 +53,12 @@ This directory will looks like: ln -s /usr/local/lib/libclntsh.dylib.11.1 /usr/local/lib/libclntsh.dylib ``` ## Test with sqlplus instantclient I recommand to install Oracle Server with a VirtualBox [VM preinstalled](http://tech.lds.org/wiki/Oracle_VM). ```bash /usr/local/bin/sqlplus oracle/[email protected] ``` ## Install extension with pecl @@ -78,5 +80,3 @@ extension=oci8.so Restart your HTTP Server and test. Enjoy (or try to...) ! -
gido revised this gist
Mar 25, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -46,7 +46,7 @@ This directory will looks like: ## Create symlinks ```bash ln -s /usr/local/instantclient/11.2.0.3/sdk/include/*.h /usr/local/include/ ln -s /usr/local/instantclient/11.2.0.3/sqlplus /usr/local/bin/ ln -s /usr/local/instantclient/11.2.0.3/*.dylib /usr/local/lib/ ln -s /usr/local/instantclient/11.2.0.3/*.dylib.11.1 /usr/local/lib/ -
gido revised this gist
Mar 25, 2013 . No changes.There are no files selected for viewing
-
gido revised this gist
Mar 25, 2013 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -77,4 +77,6 @@ extension=oci8.so Restart your HTTP Server and test. Enjoy (or try to...) ! I encourage you to install a pre-installed Oracle VM to run the server. You can [find some here](http://tech.lds.org/wiki/Oracle_VM). -
gido revised this gist
Mar 25, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,7 +5,7 @@ PHP 5.4 installed with Homebrew. ## Preparation Download the following files from [Oracle website](http://www.oracle.com/technetwork/topics/intel-macsoft-096467.html) (yes, you need to create an account and accept terms): * [instantclient-basic-macos.x64-11.2.0.3.0.zip](http://www.oracle.com/technetwork/topics/intel-macsoft-096467.html) * [instantclient-sqlplus-macos.x64-11.2.0.3.0.zip](http://www.oracle.com/technetwork/topics/intel-macsoft-096467.html) -
gido revised this gist
Mar 25, 2013 . No changes.There are no files selected for viewing
-
gido revised this gist
Mar 25, 2013 . 1 changed file with 1 addition and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -77,6 +77,4 @@ extension=oci8.so Restart your HTTP Server and test. Enjoy (or try to...) ! -
gido created this gist
Mar 25, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,82 @@ # Installation This procedure is tested on Mac OS X 10.8 with Developpers tools installed (xCode). PHP 5.4 installed with Homebrew. ## Preparation Download the following files from [Oracle website](http://www.oracle.com/technetwork/topics/intel-macsoft-096467.html): * [instantclient-basic-macos.x64-11.2.0.3.0.zip](http://www.oracle.com/technetwork/topics/intel-macsoft-096467.html) * [instantclient-sqlplus-macos.x64-11.2.0.3.0.zip](http://www.oracle.com/technetwork/topics/intel-macsoft-096467.html) * [instantclient-sdk-macos.x64-11.2.0.3.0.zip](http://www.oracle.com/technetwork/topics/intel-macsoft-096467.html) Create and unzip all theses files into a the directory `/usr/local/instantclient/11.2.0.3/`. This directory will looks like: ``` . ├── BASIC_README ├── SQLPLUS_README ├── adrci ├── genezi ├── glogin.sql ├── libclntsh.dylib.11.1 ├── libnnz11.dylib ├── libocci.dylib.11.1 ├── libociei.dylib ├── libocijdbc11.dylib ├── libsqlplus.dylib ├── libsqlplusic.dylib ├── ojdbc5.jar ├── ojdbc6.jar ├── sdk │ ├── SDK_README │ ├── demo │ ├── include │ ├── ott │ └── ottclasses.zip ├── sqlplus ├── uidrvci └── xstreams.jar ``` ## Create symlinks ```bash ln -s /usr/local/instantclient/11.2.0.3/*.h /usr/local/includes/ ln -s /usr/local/instantclient/11.2.0.3/sqlplus /usr/local/bin/ ln -s /usr/local/instantclient/11.2.0.3/*.dylib /usr/local/lib/ ln -s /usr/local/instantclient/11.2.0.3/*.dylib.11.1 /usr/local/lib/ ln -s /usr/local/lib/libclntsh.dylib.11.1 /usr/local/lib/libclntsh.dylib ``` ## Test with instantclient ```bash /usr//local/bin/sqlplus scott/tiger@myoracle ``` ## Install extension with pecl ``` pecl install oci8 ``` If the script prompt you to provide the path to ORACLE_HOME directory, respond with: ``` instantclient,/usr/local/lib ``` And your are done, normally pecl will automatically load the extension in your `php.ini`. If not, add the following line to your `php.ini`: ``` extension=oci8.so ``` Restart your HTTP Server and test. Enjoy (or try to...) ! ```