0

Good day, fellow developers!

I have been searching for 2 weeks now on how to install the OCI8 PHP extension on Elastic Beanstalk using .ebextensions but sadly I can't search for similar ones.

Before I arrived at the conclusion to use .ebextensions, I tried the Docker approach first. I created an image with OCI8 PHP extension and Oracle Instant Client dependencies. It was working fine on my local Docker Hub app but errors appeared when I tried deploying it to EB.

After reading some more information, I stumbled upon this AWS article: How do I install PECL 7 modules on Elastic Beanstalk environments running on PHP with Amazon Linux 1 stacks?. From that, I concluded that this is the best option in my case. The problem now is there are almost no articles that can be found which pertain to OCI8, Elastic Beanstalk, and .ebextensions.

Has anyone tried using the .ebextensions config files to install the OCI8 PHP extension? Any clue will really help.

1 Answers1

0

We have been able to install oci8 and oracle client using .ebextensions. We created 2 config files, one for the oracle stuff:

commands:
  01_install_basic:
     command: |
            cd /tmp
            wget https://download.oracle.com/otn_software/linux/instantclient/oracle-instantclient-basic-linuxx64.rpm
            rpm -i oracle-instantclient-basic-linuxx64.rpm
     test: '! rpm -qa |grep oracle-instantclient-basic'
  02_install_devel:
    command: |
            cd /tmp
            wget https://download.oracle.com/otn_software/linux/instantclient/oracle-instantclient-devel-linuxx64.rpm
            rpm -i oracle-instantclient-devel-linuxx64.rpm
    test: '! rpm -qa |grep oracle-instantclient-devel'
  03_install_sqlplus:
    command: |
            cd /tmp
            wget https://download.oracle.com/otn_software/linux/instantclient/oracle-instantclient-sqlplus-linuxx64.rpm
            rpm -i oracle-instantclient-sqlplus-linuxx64.rpm
            export CLIENT_HOME=/usr/lib/oracle/21/client64
            export LD_LIBRARY_PATH=$CLIENT_HOME/lib
            export PATH=$PATH:$CLIENT_HOME/bin
    test: '! rpm -qa |grep oracle-instantclient-sqlplus'

And the second for the oci8 module

commands:
  02_install_oci8:
    command:  echo '' | /usr/bin/pecl install oci8-2.2.0
    test: '! php -m |grep oci8'

It's probably not perfect but it's work for us!

Regards,

Eric

Eric
  • 1