Installing oci8 extension in linux for php?

2019-03-06 16:35发布

问题:

I don't have a oracle database installed in my system. But i want to connect to the remote system. Do i just need to install oci8 extension library or i need to install both instantclient and the oci8 extension?

回答1:

If I remember correctly, OCI8 extension wouldn't even compile without Instant Client; if you install using PECL, it asks you for Instant Client path. Moreover, from my experience, you'll also need Instant Client SDK in addition to Basic, unpack them to one directory, and make some symlinks before running PECL command:

sudo ln -s libclntsh.so.* libclntsh.so
sudo ln -s libocci.so.* libocci.so

Don't forget to enable the config later:

echo "; configuration for php oci8 module" | sudo tee /etc/php5/conf.d/oci8.ini
echo extension=oci8.so | sudo tee -a /etc/php5/conf.d/oci8.ini

Taken from this post (in Russian), also installed OCI8 myself recently on Debian 7.



标签: php oracle oci8