Skip to content

Instantly share code, notes, and snippets.

@wernerm
Last active January 25, 2020 01:08
Show Gist options
  • Select an option

  • Save wernerm/f7d8f63cad2b38913e34c27ebdb47eb1 to your computer and use it in GitHub Desktop.

Select an option

Save wernerm/f7d8f63cad2b38913e34c27ebdb47eb1 to your computer and use it in GitHub Desktop.

Revisions

  1. wernerm revised this gist Jan 25, 2020. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions oci8-ubuntu-howto.md
    Original file line number Diff line number Diff line change
    @@ -26,11 +26,11 @@ sudo unzip -d /usr/lib/oracle/ instantclient-sdk-linux.x64-19.5.0.0.0dbru.zip
    ```
    Optionally, you might need to create the symbolic link, if it has not been created by extracting the archives.
    ```sh
    sudo ln -s /usr/lib/oracle/instantclient_19_3/libclntsh.so.19.1 /usr/lib/oracle/instantclient_19_3/libclntsh.so
    sudo ln -s /usr/lib/oracle/instantclient_19_5/libclntsh.so.19.1 /usr/lib/oracle/instantclient_19_5/libclntsh.so
    ```
    Add the path to the shared Instant Client library files and configure dynamic linker run-time bindings.
    ```sh
    sudo sh -c "echo /usr/lib/oracle/instantclient_19_3 > /etc/ld.so.conf.d/oracle.conf"
    sudo sh -c "echo /usr/lib/oracle/instantclient_19_5 > /etc/ld.so.conf.d/oracle.conf"
    ```
    ```sh
    sudo ldconfig
    @@ -47,7 +47,7 @@ Install the PECL OCI8 package.
    sudo pear install pecl/oci8
    ```
    During installation, you will be prompted for the path to the ORACLE_HOME directory. Enter the path exactly as follows:
    `instantclient\,/usr/lib/oracle/instantclient_19_3`
    `instantclient\,/usr/lib/oracle/instantclient_19_5`

    After the build process completes, we need to enable PHP to load the OCI8 extension. That should automatically create a symbolic link, `/etc/php/7.2/apache2/conf.d/20-oci8.ini`.
    ```sh
  2. wernerm revised this gist Jan 25, 2020. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions oci8-ubuntu-howto.md
    Original file line number Diff line number Diff line change
    @@ -9,10 +9,10 @@ The process has been tested on new servers that have been set up using Virtualmi
    [Download](https://www.oracle.com/database/technologies/instant-client/linux-x86-64-downloads.html) the latest version of Instant Client for Linux x86-64 (64-bit). As an example, we will be installing version 19.5.0.0.0 (requires glibc 2.14).
    You only need to download the _Basic Package_ (ZIP) and the _SDK Package_ (ZIP).
    ```sh
    wget -c https://download.oracle.com/otn_software/linux/instantclient/193000/instantclient-basic-linux.x64-19.5.0.0.0dbru.zip
    wget -c https://download.oracle.com/otn_software/linux/instantclient/195000/instantclient-basic-linux.x64-19.5.0.0.0dbru.zip
    ```
    ```sh
    wget -c https://download.oracle.com/otn_software/linux/instantclient/193000/instantclient-sdk-linux.x64-19.5.0.0.0dbru.zip
    wget -c https://download.oracle.com/otn_software/linux/instantclient/195000/instantclient-sdk-linux.x64-19.5.0.0.0dbru.zip
    ```
    Extract the downloaded archives to an arbitrary location. We'll use `/usr/lib/oracle/`.
    ```sh
  3. wernerm revised this gist Jan 25, 2020. 1 changed file with 6 additions and 6 deletions.
    12 changes: 6 additions & 6 deletions oci8-ubuntu-howto.md
    Original file line number Diff line number Diff line change
    @@ -4,25 +4,25 @@

    The process has been tested on new servers that have been set up using Virtualmin's installation script.

    ### Setting up Instant Client 19.3
    ### Setting up Instant Client 19.5

    [Download](https://www.oracle.com/database/technologies/instant-client/linux-x86-64-downloads.html) the latest version of Instant Client for Linux x86-64 (64-bit). As an example, we will be installing version 19.3.0.0.0 (requires glibc 2.14).
    [Download](https://www.oracle.com/database/technologies/instant-client/linux-x86-64-downloads.html) the latest version of Instant Client for Linux x86-64 (64-bit). As an example, we will be installing version 19.5.0.0.0 (requires glibc 2.14).
    You only need to download the _Basic Package_ (ZIP) and the _SDK Package_ (ZIP).
    ```sh
    wget -c https://download.oracle.com/otn_software/linux/instantclient/193000/instantclient-basic-linux.x64-19.3.0.0.0dbru.zip
    wget -c https://download.oracle.com/otn_software/linux/instantclient/193000/instantclient-basic-linux.x64-19.5.0.0.0dbru.zip
    ```
    ```sh
    wget -c https://download.oracle.com/otn_software/linux/instantclient/193000/instantclient-sdk-linux.x64-19.3.0.0.0dbru.zip
    wget -c https://download.oracle.com/otn_software/linux/instantclient/193000/instantclient-sdk-linux.x64-19.5.0.0.0dbru.zip
    ```
    Extract the downloaded archives to an arbitrary location. We'll use `/usr/lib/oracle/`.
    ```sh
    sudo mkdir -p /usr/lib/oracle/
    ```
    ```sh
    sudo unzip -d /usr/lib/oracle/ instantclient-basic-linux.x64-19.3.0.0.0dbru.zip
    sudo unzip -d /usr/lib/oracle/ instantclient-basic-linux.x64-19.5.0.0.0dbru.zip
    ```
    ```sh
    sudo unzip -d /usr/lib/oracle/ instantclient-sdk-linux.x64-19.3.0.0.0dbru.zip
    sudo unzip -d /usr/lib/oracle/ instantclient-sdk-linux.x64-19.5.0.0.0dbru.zip
    ```
    Optionally, you might need to create the symbolic link, if it has not been created by extracting the archives.
    ```sh
  4. wernerm revised this gist Nov 1, 2019. 1 changed file with 1 addition and 4 deletions.
    5 changes: 1 addition & 4 deletions oci8-ubuntu-howto.md
    Original file line number Diff line number Diff line change
    @@ -40,10 +40,7 @@ sudo ldconfig

    Install the required Ubuntu packages. Some may have been installed already.
    ```sh
    sudo sudo apt-get install php-dev php-db
    ```
    ```sh
    sudo apt-get install libaio1
    sudo sudo apt-get install php-dev php-db libaio1
    ```
    Install the PECL OCI8 package.
    ```sh
  5. wernerm revised this gist Nov 1, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion oci8-ubuntu-howto.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    # Installing OCI8 on Ubuntu 18.04

    ### Instructions to install the OCI8 extension for PHP 7.2 on Ubuntu 18.04 LTS (Bionic)
    ## Instructions to install the OCI8 extension for PHP 7.2 on Ubuntu 18.04 LTS (Bionic)

    The process has been tested on new servers that have been set up using Virtualmin's installation script.

  6. wernerm revised this gist Nov 1, 2019. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions oci8-ubuntu-howto.md
    Original file line number Diff line number Diff line change
    @@ -2,6 +2,8 @@

    ### Instructions to install the OCI8 extension for PHP 7.2 on Ubuntu 18.04 LTS (Bionic)

    The process has been tested on new servers that have been set up using Virtualmin's installation script.

    ### Setting up Instant Client 19.3

    [Download](https://www.oracle.com/database/technologies/instant-client/linux-x86-64-downloads.html) the latest version of Instant Client for Linux x86-64 (64-bit). As an example, we will be installing version 19.3.0.0.0 (requires glibc 2.14).
  7. wernerm revised this gist Nov 1, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion oci8-ubuntu-howto.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    # Installing OCI8 on Ubuntu 18.04

    ### Instructions to install the OCI8 extension for PHP 7 on Ubuntu 18.04 LTS (Bionic)
    ### Instructions to install the OCI8 extension for PHP 7.2 on Ubuntu 18.04 LTS (Bionic)

    ### Setting up Instant Client 19.3

  8. wernerm revised this gist Nov 1, 2019. No changes.
  9. wernerm created this gist Nov 1, 2019.
    73 changes: 73 additions & 0 deletions oci8-ubuntu-howto.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,73 @@
    # Installing OCI8 on Ubuntu 18.04

    ### Instructions to install the OCI8 extension for PHP 7 on Ubuntu 18.04 LTS (Bionic)

    ### Setting up Instant Client 19.3

    [Download](https://www.oracle.com/database/technologies/instant-client/linux-x86-64-downloads.html) the latest version of Instant Client for Linux x86-64 (64-bit). As an example, we will be installing version 19.3.0.0.0 (requires glibc 2.14).
    You only need to download the _Basic Package_ (ZIP) and the _SDK Package_ (ZIP).
    ```sh
    wget -c https://download.oracle.com/otn_software/linux/instantclient/193000/instantclient-basic-linux.x64-19.3.0.0.0dbru.zip
    ```
    ```sh
    wget -c https://download.oracle.com/otn_software/linux/instantclient/193000/instantclient-sdk-linux.x64-19.3.0.0.0dbru.zip
    ```
    Extract the downloaded archives to an arbitrary location. We'll use `/usr/lib/oracle/`.
    ```sh
    sudo mkdir -p /usr/lib/oracle/
    ```
    ```sh
    sudo unzip -d /usr/lib/oracle/ instantclient-basic-linux.x64-19.3.0.0.0dbru.zip
    ```
    ```sh
    sudo unzip -d /usr/lib/oracle/ instantclient-sdk-linux.x64-19.3.0.0.0dbru.zip
    ```
    Optionally, you might need to create the symbolic link, if it has not been created by extracting the archives.
    ```sh
    sudo ln -s /usr/lib/oracle/instantclient_19_3/libclntsh.so.19.1 /usr/lib/oracle/instantclient_19_3/libclntsh.so
    ```
    Add the path to the shared Instant Client library files and configure dynamic linker run-time bindings.
    ```sh
    sudo sh -c "echo /usr/lib/oracle/instantclient_19_3 > /etc/ld.so.conf.d/oracle.conf"
    ```
    ```sh
    sudo ldconfig
    ```

    ### Setting up the OCI8 PHP extension

    Install the required Ubuntu packages. Some may have been installed already.
    ```sh
    sudo sudo apt-get install php-dev php-db
    ```
    ```sh
    sudo apt-get install libaio1
    ```
    Install the PECL OCI8 package.
    ```sh
    sudo pear install pecl/oci8
    ```
    During installation, you will be prompted for the path to the ORACLE_HOME directory. Enter the path exactly as follows:
    `instantclient\,/usr/lib/oracle/instantclient_19_3`

    After the build process completes, we need to enable PHP to load the OCI8 extension. That should automatically create a symbolic link, `/etc/php/7.2/apache2/conf.d/20-oci8.ini`.
    ```sh
    sudo echo "extension=oci8.so" > /etc/php/7.2/mods-available/oci8.ini
    ```
    ```sh
    sudo phpenmod oci8
    ```
    We now need to restart Apache.
    ```sh
    sudo service apache2 restart
    ```

    ### Verification

    Verify that the OCI8 extension has been installed and that it can be loaded by PHP.
    ```sh
    php -m | grep oci8
    ```
    ```sh
    echo "<?php phpinfo();" | php | grep "OCI8 Support"
    ```