Problem installing OCI8 on a vm of Vagrant

2

I've created a VM with Laravel Homestead I need to install OCI8 on it:

Run the command sudo pecl install oci8 as reported here

But I get this error:

  

ERROR: '/ tmp / pear / temp / oci8 / configure    - with-php-config = / usr / bin / php-config --with-oci8 'failed

I'm using PHP 7.1.0 I do not know if there's anything to see.

    
asked by anonymous 30.01.2017 / 19:33

1 answer

3

Basically I followed a tutorial, I'll pass it on to the answer and link it to the end of the answer:

  

Oracle Instant Client installation

Step 1:

Download Oracle Instant Client and SDK of the Oracle site. Be sure to choose the correct architecture for the installation (32bit x86, 64bit x86_64). You will need to upload the files to your server using whatever method suits you.

Step 2:

Create a new folder to store Oracle Instant Client zip files on your server.

Running the command:

sudo mkdir /opt/oracle

Step 3:

Now extract the files:

cd /opt/oracle

sudo unzip instantclient-basic-linux-12.1.0.2.0.zip

sudo unzip instantclient-sdk-linux-12.1.0.2.0.zip

Step 4:

Create a symbolic link to the Instant Client files.

ln -s /opt/oracle/instantclient_12_1/libclntsh.so.12.1 /opt/oracle/instantclient_12_1/libclntsh.so

ln -s /opt/oracle/instantclient_12_1/libocci.so.12.1 /opt/oracle/instantclient_12_1/libocci.so

Step 5: (in this step I needed to change permissions on ld.so.conf.d with sudo chmod 777 )

Add the folder at ldconfig

echo /opt/oracle/instantclient_12_1 > /etc/ld.so.conf.d/oracle-instantclient

Step 6:

Update dynamic linker runtime links

sudo ldconfig
  

Installing OCI8

1st step: (I did not do this step, I used php 7.1.1 )

Run these commands to install php-dev:

sudo apt-get install php-pear php5-dev build-essential libaio1

Step 2:

Once installed, we need to get the OCI8 file.

pecl install oci8-2.0.10

When the prompt asks where the Instant Client is, type:

instantclient,/opt/oracle/instantclient_12_1

Step 3:

Enable the extension of oci8 in

sudo echo "extension = oci8.so" >> /etc/php5/fpm/php.ini

sudo echo "extension = oci8.so" >> /etc/php5/cli/php.ini

Step 4:

Restart your PHP and nginx / apache.

service php5-fpm restart

service nginx(ou apache) restart

Source: syahzul

    
07.02.2017 / 16:39