Hello…
Can someone help me. I hv success developed a simple demo system using Yii2 and Mysql.
The problem happen when i try convert my database mysql to oracle.
This is several configuration involved:
- php.ini
;extension=php_oci8.dll
extension=php_oci8_11g.dll
extension=php_pdo_mysql.dll
- Success when test with php and oracle
<?php
header('Access-Control-Allow-Origin: *');
$tns = "
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = xe)
)
)
";
try {
$conn = new PDO("oci:dbname=".$tns, 'demoyii2', 'pwd');
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
echo 'SUCCESS: ';
} catch(PDOException $e) {
echo 'ERROR: ' . $e->getMessage();
}
?>
- db.php
return [
'class' => 'yii\db\Connection',
'dsn' => 'oci:dbname=//localhost:1521/xe', // Oracle
'username' => 'demoyii2',
'password' => 'pwd',
'charset' => 'utf8',
];
-
Use dektrium/yii2-user
-
When convert database mysql (table user) to oracle (become table user_). I rename it user_ to "user" in oracle
When try open the system, this error happen : The table does not exist: {{%user}} exists.
I try edit table name in
vendor/dektrium/yii2-user/models/User.php
but still have an error.
public static function tableName()
{
//return '{{%user}}';
return "user";
}
Anyone help?