Difference between #5 and #6 of
How to install pdo_oci

Revision #6 has been created by gallego123 on May 13, 2011, 11:55:36 AM with the memo:

better format
« previous (#5)

Changes

Title unchanged

How to install pdo_oci

Category changed

TutorialHow-tos

Yii version unchanged

Tags unchanged

pdo oci php

Content changed

These are the steps to install pdo_oci --------------------------------------
 
From: [http://lacot.org/](http://lacot.org/ "http://lacot.org/") and me. >>*~$ > sudo apt-get install apache2 php5 php5-cli php5-xdebug php5-memcache php5-mcrypt php5-imagick php5-gd php5-xsl subversion imagemagick unzip htop memcached* >>*~$ > sudo apt-get install php5-dev* >>*~$ > sudo apt-get install php-pear* Install the libraries from "Oracle Instant Client" 
Go to the site and download:
[...]
>>*~$ > cd /tmp/* >>*~$ > unzip oracle-instantclient-basic-10.2.0.4-1.i386.zip* >>*~$ > mv instantclient_10_2 /opt/* >>*~$ > unzip oracle-instantclient-devel-10.2.0.4-1.i386.zip* >>*~$ > mv instantclient_10_2/sdk /opt/instantclient_10_2/* >>*~$ > export ORACLE_HOME=/opt/instantclient_10_2/* >>*~$ > ln -s /opt/instantclient_10_2/libclntsh.so.10.1 /opt/instantclient_10_2/libclntsh.so* >>*~$ > ln -s /opt/instantclient_10_2/libocci.so.10.1 /opt/instantclient_10_2/libocci.so* >>*~$ > ln -s /opt/instantclient_10_2/ /opt/instantclient_10_2/lib* >>*~$ > pecl download pdo PDO_OCI OCI8* >>*~$ > tar xzvf PDO-1.0.3.tgz* (the version can vary) >>*~$ > tar xzvf oci8-1.4.1.tgz* >>*~$ > tar xzvf PDO_OCI-1.0.tgz* install "re2c 0.12.0 or later".
 
i've done wiht the package manager, but I think is something like
 
>>*
~$ > apt-get install re2c*
 
>>*
 
~$ > 
cd PDO-1.0.3* >>*~$ > phpize* >>*~$ > ./configure* >>*~$ > make* >>*~$ > sudo make install*
 

 
>>*
~$ > cd ../oci8-1.4.1* >>*~$ > phpize* >>*~$ > ./configure --with-oci8=instantclient,/opt/instantclient_10_2/* >>*~$ > make* >>*~$ > sudo make install*
 
 
 
 
>>*

 
 
~$ > 
cd ../PDO_OCI-1.0* >>*~$ > cp /opt/instantclient_10_2/sdk/include/\*.h .* >>*~$ > phpize* >>*~$ > ./configure* >>*~$ > make* >>*~$ > sudo make install* #### And then, you can verify with: >>*
 
 
```php 
<?php phpinfo(); ?>*  ``` After that, you can configure the connection in config/main.php
 
 
```php 
'db'=> array( 'class'=> 'CDbConnection', 'connectionString'=> 'oci:dbname=10.XX.XX.XX/xe', 'username'=> 'USER_NAME', 'password'=> 'your_passsword' ), ``` #### And, if some error of this style appears: >
 
 
exception 'CDbException' with message 'CDbCommand failed to execute the SQL statement: SQLSTATE\[HY000\]: General error: 942 OCIStmtExecute: ORA-00942: table or view does not exist  (/tmp/PDO_OCI-1.0/oci_statement.c:142)* is because of that: [Bug 20/04/10](http://www.yiiframework.com/forum/index.php?/topic/7904-yii-1-1-1-oci-does-not-have-to-quote-names/ "Bug 20/04/10")
 
 
 
#### others errors configure: error: Cannot find php_pdo_driver.h. ~$ > cd /usr/include ~$ > sudo ln -s php5 php
[...]
thanks [PoL](http://www.yiiframework.com/forum/index.php?/user/67-pol/ "PoL")

 
1 0
3 followers
Viewed: 36 442 times
Version: 1.1
Category: How-tos
Written by: gallego123
Last updated by: gallego123
Created on: Apr 20, 2010
Last updated: 12 years ago
Update Article

Revisions

View all history