Revision #6 was created by gallego123 on May 13, 2011, 11:55:36 AM.
better format
Category
TutorialHow-tos
Content
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")