0

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!

user2511599
  • 796
  • 1
  • 13
  • 38
  • first check phpinfo, is there correct pdo config? – zakrzu Feb 21 '17 at 10:37
  • I think you shoul read this post: http://stackoverflow.com/questions/26796850/uncaught-exception-pdoexception-with-message-could-not-find-driver-to-an-or – zakrzu Feb 21 '17 at 10:39
  • I can't get it to work. I've tried now all versions, all Paths, no luck. However wampserver is starting without any errors after selecting extensions, in phpinfo i can't see them. – user2511599 Feb 21 '17 at 13:27
  • I've noticed in phpinfo Configure Command: **"--with-pdo-oci=c:\php-sdk\oracle\x64\instantclient_12_1\sdk,shared"** so I've moved instantclient_12_1, changed Path also according to that, but still not working. I'm completely stuck. – user2511599 Feb 21 '17 at 13:33
  • from link "you also have to have an ORACLE driver installed on your system. The PHP extension is just an interface between your PHP code and the ORACLE driver," did you install driver? – zakrzu Feb 21 '17 at 21:20
  • oracle instantclient-basiclite-windows.x64-12.1.0.2.0 alias instantclient_12_1 should be the driver, shouldn't it? – user2511599 Feb 22 '17 at 05:08

0 Answers0