Hi all:
I’m new to PHP and frameworks so perhaps what I’m doing is wrong and I can’t tell but here it goes…
Environment:
-
Oracle 10g (10.2.0.4) under Windows Server 2003 SP2
-
Oracle Apache server 1.3
-
PHP 5.2.11 for Windows
-
Yii 1.1rc.r1585
Background:
Apache wouldn’t load the php_pdo_oci.dll extension from PHP 5.2.11 but the PHP CLI did load it. With it, yiic would allow the creation of models and cruds but since Apache didn’t recognize it, whenever I tried to access the list.php page for the model I would get a “driver not found” error. I downgraded to the dll from EasyPHP 2.0b (PHP 5.0?) as both Apache and the CLI seem to recognize it.
The problem:
If I write a simple page with the following statement:
$conn = new PDO(‘oci:dbname=mydb’, ‘myusername’, ‘mypassword’);
it executes fine with no errors. However, when setting up the Yii connection in protected\config\main.php as follows:
‘db’=>array(
'class'=>'CDbConnection',
'connectionString'=>'oci:mydb',
'username'=>'myusername',
'password'=>'mypassword',
and then attempt to create a model using yiic I get the following error message:
exception ‘CDbException’ with message 'CDbConnection failed to open the DB conne
ction: SQLSTATE[HY000]: pdo_oci_handle_factory: ORA-12560: TNS:protocol adapter
error ext\pdo_oci\oci_driver.c:579)’ in I:\WEB\yii\framework\db\CDbConnection.php:262
I have also tried the long connectionString ‘oci://servername:1521/mydb’ to no avail.
The question is, do I have a .dll problem, a syntax problem or is it a Yii bug? Any help will be greatly appreciated.
Regards,
José