Skip to content

Instantly share code, notes, and snippets.

Revisions

  1. jakofranko revised this gist Mar 7, 2016. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions macosx-install-php-oracle-oci8-pdo_oci.md
    Original 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`.
    ## 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/krisanalfa/e0beaa512b4677c51a7c/raw/214c36a65685c9c24102ad7b703d040a7fb60243/config.m4.patch
    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,/usr/local/lib,11.2.0.4
    ./configure --with-pdo-oci=instantclient,/Library/Oracle/instantclient_11_2,11.2.0.4
    ```

    Build it and install it:
  2. jakofranko revised this gist Mar 7, 2016. 1 changed file with 9 additions and 7 deletions.
    16 changes: 9 additions & 7 deletions macosx-install-php-oracle-oci8-pdo_oci.md
    Original 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 `/usr/local/instantclient/11.2.0.4/`.
    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 extension with pecl
    ## 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,/usr/local/lib
    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.

    To installing `pdo_oci`. You must do following command:
    ## Installing `pdo_oci`.

    Execute the following commands:

    ```
    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
    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
  3. @krisanalfa krisanalfa revised this gist Mar 6, 2016. 1 changed file with 14 additions and 2 deletions.
    16 changes: 14 additions & 2 deletions macosx-install-php-oracle-oci8-pdo_oci.md
    Original 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

    ```
    sudo pecl install oci8
    ```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`:

    ```
  4. @krisanalfa krisanalfa revised this gist Nov 30, 2015. 1 changed file with 7 additions and 0 deletions.
    7 changes: 7 additions & 0 deletions macosx-install-php-oracle-oci8-pdo_oci.md
    Original 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.

    ```
  5. @krisanalfa krisanalfa revised this gist Oct 5, 2015. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions macosx-install-php-oracle-oci8-pdo_oci.md
    Original 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
    ```

  6. @krisanalfa krisanalfa renamed this gist Oct 2, 2015. 1 changed file with 40 additions and 1 deletion.
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    # Installation
    This procedure is tested on Mac OS X 10.8 with Developpers tools installed (xCode).
    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!
  7. @krisanalfa krisanalfa revised this gist Oct 1, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion macosx-install-php-oracle-oci8.md
    Original 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.4 installed with Homebrew.
    PHP 5.6 installed with Homebrew.

    ## Preparation

  8. @krisanalfa krisanalfa revised this gist Jun 17, 2014. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions macosx-install-php-oracle-oci8.md
    Original 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.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/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
    ```

  9. @krisanalfa krisanalfa revised this gist Jun 17, 2014. 1 changed file with 15 additions and 19 deletions.
    34 changes: 15 additions & 19 deletions macosx-install-php-oracle-oci8.md
    Original 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.

    **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):

    * [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)

    * [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.3/`.
    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

    ```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/
    ln -s /usr/local/lib/libclntsh.dylib.11.1 /usr/local/lib/libclntsh.dylib
    ```
    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).

    ```bash
    /usr/local/bin/sqlplus oracle/[email protected]
    ```
    sudo /usr/local/bin/sqlplus oracle/[email protected]
    ```

    ## Install extension with pecl

    ```
    pecl install oci8
    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.

    Enjoy (or try to...) !
  10. @gido gido revised this gist Apr 2, 2013. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions macosx-install-php-oracle-oci8.md
    Original 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):
  11. @gido gido revised this gist Mar 25, 2013. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions macosx-install-php-oracle-oci8.md
    Original 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 instantclient
    ## 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 scott/tiger@myoracle
    /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...) !

    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).
  12. @gido gido revised this gist Mar 25, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion macosx-install-php-oracle-oci8.md
    Original 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/*.h /usr/local/includes/
    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/
  13. @gido gido revised this gist Mar 25, 2013. No changes.
  14. @gido gido revised this gist Mar 25, 2013. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion macosx-install-php-oracle-oci8.md
    Original 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...) !
    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).
  15. @gido gido revised this gist Mar 25, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion macosx-install-php-oracle-oci8.md
    Original 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):
    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)
  16. @gido gido revised this gist Mar 25, 2013. No changes.
  17. @gido gido revised this gist Mar 25, 2013. 1 changed file with 1 addition and 3 deletions.
    4 changes: 1 addition & 3 deletions macosx-install-php-oracle-oci8.md
    Original 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...) !

    ```
    Enjoy (or try to...) !
  18. @gido gido created this gist Mar 25, 2013.
    82 changes: 82 additions & 0 deletions macosx-install-php-oracle-oci8.md
    Original 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...) !

    ```