1
I have a php application that requires an oracle connection 12c and when performing the "compilation" on Azure the following error is displayed during the composer install
Problem 1
- Installation request for yajra/Laravel-oci8 v5.5.9 -> satisfiable by yajra/Laravel-oci8[v5.5.9].
- yajra/Laravel-oci8 v5.5.9 requires ext-oci8 >=2.0.0 -> the requested PHP Extension oci8 is Missing from your system.
Looking at some websites, I saw that it is necessary to install the PECL and soon after installing the oci8.
I discovered some bash codes that install PECL and oci8, but it requires a package installer, apt, dpkg and the linux host of Azure has no package installer to run the bash file.
Detailed information:
- VM: Ubuntu 16.04.6 LTS
- PHP version: 7.2
- Azure Devops (Cloud)
Links related to the problem:
- oracle-Instant-client (Gist Github)
- How to install PECL on a linux system (Stack Exchange)
- oic8 ()
- Run a Self-hosted agent Behind a web proxy (Docs.microsoft)
- yajra/Laravel-oci8 (Github)
Edit 1:
I ran this script based on tutorials I found but the problem still persists.
sudo apt-get install php-pear;
sudo apt-get install php5-dev;
sudo apt-get install libcurl3-openssl-dev;
sudo /etc/init.d/apache2 restart ;
sudo apt-get update -qq;
sudo apt-get -y install -qq build-essential unzip wget libaio1;
sudo mkdir -p /opt/oracle;
wget https://github.com/bumpx/oracle-instantclient/raw/master/instantclient-basic-linux.x64-12.1.0.2.0.zip;
wget https://github.com/bumpx/oracle-instantclient/raw/master/instantclient-sdk-linux.x64-12.1.0.2.0.zip;
sudo unzip -o ./instantclient-basic-linux.x64-12.1.0.2.0.zip -d /opt/oracle;
sudo unzip -o ./instantclient-sdk-linux.x64-12.1.0.2.0.zip -d /opt/oracle;
sudo ln -s /opt/oracle/instantclient/sqlplus /usr/bin/sqlplus;
sudo ln -s /opt/oracle/instantclient_12_1 /opt/oracle/instantclient;
sudo ln -s /opt/oracle/instantclient/libclntsh.so.12.1 /opt/oracle/instantclient/libclntsh.so;
sudo ln -s /opt/oracle/instantclient/libocci.so.12.1 /opt/oracle/instantclient/libocci.so;
sudo pecl channel-update pecl.php.net;
echo 'instantclient,/opt/oracle/instantclient' | sudo pecl install oci8;
Caro @Propeus any of these resolve https://answall.com/q/71549/3635 ?
– Guilherme Nascimento
@Guilherme Nascimento thank you for your help, but the solution to the topic had no effect on this problem.
– Propeus
Dear Propeus, but how far did you get from the suggested solution? Where exactly did you fail? Because it’s one thing not to work for your case, it’s another thing for you not to have understood the solution well, and that’s why you couldn’t solve it.
– Guilherme Nascimento
Hello @Guilherme Nascimento, sorry for the delay in answering. There are two points that prevent you from following your instructions, first, the command "yum install php-Pdo" does not work for me because the build vm is Ubuntu with the apt-get pacore manager, the closest solution I found for this problem was this link (digitalocean), the second was a question about the ". /configure" command, this command would be executed in the oic8 directory or in php?
– Propeus
But just adapt expensive Propeus, if you know Ubuntu, know APT, a quick search on apt-get Pdo and you would know the command for Ubuntu and debian, so you can follow with the other instructions, and when crashing research on the part that is not about Ubuntu... of course instead of editing php.ini in Ubuntu you can use phpenmod
sudo phpenmod pdo_oci
(if it is php7)... but this is one of more ways to do.– Guilherme Nascimento