问题
I have:
- Windows Server 2012 R2
- wampserver 3.0.6 64bit
- yii2
- php_oci8_12c enabled,
- php_pdo_oci enabled,
- oracle instantclient-basiclite-windows.x64-12.1.0.2.0
- System Path defined according
- added mod_fcgid 2.3.9 to Apache
- added oci8 2.0.12 Thread Safe x64 for PHP 5.6 (replaced old php_oci8_12c.dll)
I see PDO for Oracle in phpinfo.
I have a db_o.php config file:
return [
'class' => 'yii\db\Connection',
'dsn' => 'oci:dbname=//SOME_IP_ADDRESS:PORT/YOUR_SID;charset=UTF8',
'username' => '',
'password' => '',
];
Based on this oracle article I've managed to set up everything and basically it works (with limitations), however changes are needed:
- it doesn't have to be NTS, I have used TS components everywhere
- as wampserver uses phpForApache.ini, and Fcgid config needs php.ini, I had to duplicate phpForApache.ini and rename it to php.ini.
- instead of
<Directory "c:/Apache24/htdocs">
of course I had to add +ExecCGI to<Directory "${INSTALL_DIR}/www/">
I get now in gii table names while generating model, but:
- if I need relations, it takes more than 2 minutes, so wampserver is stopping. I don't know why, but I think it's because the database and relations are simply too complicated (lot of composite keys etc.). I'm getting Internal Server Error, before max_execution_time (I have to change it in both php ini files). I've found in apache error log that it was caused by mod_fcgid (read timeout from pipe), so I have changed FcgidIOTimeout and FcgidBusyTimeout also to 300 (sec.) and memory_limit to 512M because it was also not enough. Why does it need so many resources I have no clue, because in the end it has only 3 relations generated. :]
So it works now. No questions. Many thanks!
来源:https://stackoverflow.com/questions/42362689/yii2-oracle-11g-gii-relations-timeout