Install Oracle Instant Client and SDK
Step 1
Download the latest Oracle Instant Client and SDK from the Oracle website (Yeah, fuck you Oracle, you need to create an account to download the files).
http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html
Look for instantclient-basic-linux.x64-12.2.0.1.0.zip and instantclient-sdk-linux.x64-12.2.0.1.0.zip.
Step 2
Create a new folder to store the Oracle Instant Client files on your machine.
mkdir /opt/oracle
And move your files to /opt/oracle.
Step 3
Extract the files
cd /opt/oracle
unzip instantclient-basic-linux.x64-12.2.0.1.0.zip
unzip instantclient-sdk-linux.x64-12.2.0.1.0.zip
Step 4
Next, we need to symlink the .so files.
ln -s /opt/oracle/instantclient_12_2/libclntsh.so.12.2 /opt/oracle/instantclient_12_2/libclntsh.so
ln -s /opt/oracle/instantclient_12_2/libocci.so.12.2 /opt/oracle/instantclient_12_2/libocci.so
Step 5
Now lets add the folder to the ldconfig's config folder.
echo /opt/oracle/instantclient_12_2 > /etc/ld.so.conf.d/oracle-instantclient.conf
And update the dynamic linker runtime bindings.
ldconfig
Great! We're almost there!
Add the extension to PHP
To install the OCI8 extension, we need to get some additional packages.
Step 1
Run these commands to install the necessary packages:
apt install php-dev php-pear build-essential libaio1
Step 2
Install the oci8 extension via PECL.
echo "instantclient,/opt/oracle/instantclient_12_2" | pecl install oci8
Step 3
We now can tell PHP to load the OCI8 extension.
echo "extension=oci8.so" >> /etc/php/7.1/mods-available/oci8.ini
ln -s /etc/php/7.1/mods-available/oci8.ini /etc/php/7.1/cli/conf.d/20-oci8.ini
ln -s /etc/php/7.1/mods-available/oci8.ini /etc/php/7.1/fpm/conf.d/20-oci8.ini
Step 4
Check if the extension is enabled.
php -m | grep oci8
php-fpm7.1 -m | grep oci8
If you see oci8, you're almost done!
Step 5
Restart PHP-FPM.
service php7.1-fpm restart
Finished! Well done! Thanks for pulling through with this tedious procedure!
Step 1
Download the latest Oracle Instant Client and SDK from the Oracle website (Yeah, fuck you Oracle, you need to create an account to download the files).
http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html
Look for instantclient-basic-linux.x64-12.2.0.1.0.zip and instantclient-sdk-linux.x64-12.2.0.1.0.zip.
Step 2
Create a new folder to store the Oracle Instant Client files on your machine.
mkdir /opt/oracle
And move your files to /opt/oracle.
Step 3
Extract the files
cd /opt/oracle
unzip instantclient-basic-linux.x64-12.2.0.1.0.zip
unzip instantclient-sdk-linux.x64-12.2.0.1.0.zip
Step 4
Next, we need to symlink the .so files.
ln -s /opt/oracle/instantclient_12_2/libclntsh.so.12.2 /opt/oracle/instantclient_12_2/libclntsh.so
ln -s /opt/oracle/instantclient_12_2/libocci.so.12.2 /opt/oracle/instantclient_12_2/libocci.so
Step 5
Now lets add the folder to the ldconfig's config folder.
echo /opt/oracle/instantclient_12_2 > /etc/ld.so.conf.d/oracle-instantclient.conf
And update the dynamic linker runtime bindings.
ldconfig
Great! We're almost there!
Add the extension to PHP
To install the OCI8 extension, we need to get some additional packages.
Step 1
Run these commands to install the necessary packages:
apt install php-dev php-pear build-essential libaio1
Step 2
Install the oci8 extension via PECL.
echo "instantclient,/opt/oracle/instantclient_12_2" | pecl install oci8
Step 3
We now can tell PHP to load the OCI8 extension.
echo "extension=oci8.so" >> /etc/php/7.1/mods-available/oci8.ini
ln -s /etc/php/7.1/mods-available/oci8.ini /etc/php/7.1/cli/conf.d/20-oci8.ini
ln -s /etc/php/7.1/mods-available/oci8.ini /etc/php/7.1/fpm/conf.d/20-oci8.ini
Step 4
Check if the extension is enabled.
php -m | grep oci8
php-fpm7.1 -m | grep oci8
If you see oci8, you're almost done!
Step 5
Restart PHP-FPM.
service php7.1-fpm restart
Finished! Well done! Thanks for pulling through with this tedious procedure!
Komentar
Posting Komentar