Here are a few steps to have your PHP with Oracle (OCI8) support. I assume you already have Apache and PHP running. I have tested this procedure with Ubuntu 8.04 (Hardy, LTS) Server Edition.
Segue alguns poucos passos para ter o PHP com suporte a Oracle (OCI8). Estou assumindo que Apache e PHP já estão instalados e executando. Testei estes procedimentos no Ubuntu 8.04 (Hardy, LTS) Server Edition.
Install some needed packages:
Instale alguns pacotes necessários:
sudo apt-get install php-pear php5-dev libaio1 build-essential
Baixe o Oracle Instant Client:
Download the Oracle Instant Client:
http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/linuxsoft.html
Você precisa dos pacotes:
You need the packages:
- Basic client
- SDK
- SQL Plus (Optional)
Unzip all downloaded files in /opt/instantclient
Descompacte os arquivos baixados em /opt/instantclient
Execute os comandos abaixo:
Run the commands below:
cd /opt/instantclient
sudo ln -s libclntsh.so.11.1 libclntsh.so
sudo ln -s libocci.so.11.1 libocci.so
sudo sh -c ‘echo “/opt/instantclient” > /etc/ld.so.conf.d/oracle.conf’
sudo ldconfig
Vamos instalar o módulo OCI8:
Let’s install OCI8 module:
sudo pecl install oci8
Quando for perguntado o path (caminho) do Oracle, digite:
When asked for Oracle PATH, type:
all <ENTER>
instantclient,/opt/instantclient <ENTER>
<ENTER>
Coloque a extensão recém criada nas configurações do PHP:
Put the newly created extension in PHP config:
sudo sh -c ‘echo “extension=oci8.so” > /etc/php5/conf.d/oracle.ini’
Reinicie o apache:
Restart your apache:
sudo /etc/init.d/apache2 restart
Verifique com phpinfo() se o módulo OCI8 foi carregado.
Check with phpinfo() if OCI8 module was loaded.
É isso!
That’s All!