CakeDC / cakephp-oracle-driver

CakePHP 3 Driver for Oracle Database
Other
40 stars 24 forks source link

Bake a model when you are connected to an oracle database #8

Closed hanuka closed 7 years ago

hanuka commented 8 years ago

Is it possible to use bake tool to bake a model when you are connected to a oracle database? I tried to use bake model and I get this Exception: Database driver CakeDC\OracleDriver\Database\Driver\OracleOCI cannot be used due to a missing PHP extension or unmet dependency in [/var/www/html/test/vendor/cakephp/cakephp/src/Database/Connection.php, line 169]

skie commented 8 years ago

There is something with oci extension for php for your installation. Please check if php compiled correctly with this extension or if you using windows check if it is enabled.

aconcetto commented 8 years ago

Exception: Database driver CakeDC\OracleDriver\Database\Driver\OracleOCI cannot be used due to a missing PHP extension or unmet dependency in [/var/www/html/sistemas/base/vendor/cakephp/cakephp/src/Database/Connection.php, line 170] 2016-08-05 14:41:14 Error: [Cake\Database\Exception\MissingExtensionException] Database driver CakeDC\OracleDriver\Database\Driver\OracleOCI cannot be used due to a missing PHP extension or unmet dependency screenshot from 2016-08-05 10-49-44

I got this error trying to use cake bake, the oci library its running the main project says that its connected, even y have make some tests in pure php code and it connects to the database and i can make CRUD operations. what can i do?

tn-info commented 7 years ago

Same problem using cake bake with the plugin. I use Windows 10, WampServer 3.0.6 (64bit) with Apache 2.4.23, PHP 5.6.27 and PHP 7.0.10. PHP 7 is activated. I use CakePHP 3.3.5 and the master branch of the Oracle plugin (with case correction for foreign keys). Oci is activated. Everything works fine from the browser, database connection and CRUD. But I have exactly the same error as mentioned above.

skie commented 7 years ago

The possible reason could be described here http://stackoverflow.com/a/22771081 In two works there are separate php.ini files for console and for web server. If you on windows use command php -i | findstr /R /C:"oci" to check if you have oci8 added here.

In *nix systems use php -i | grep oci for same task.

tn-info commented 7 years ago

Indeed, the problem was related to WampServer 3.0.6 (64bit). In the "\bin\php\php7.0.10\php.ini" file line "extension=php_oci8_12c.dll" was absent as she is present and uncommented in the "\bin\apache\apache2.4.23\bin\php.ini". Problem solved for me. Thank you very much @skie .