Hello guys. My project runs fine on windows using xampp. Now I try to implement it on a live server environment and I have come across a few issues (I have asked the same on stackoverflow too) . My OS is CENTOS 7 Server. The Database version is the oracle 12c release2 and my Laravel version is the 5.7.28
I have installed php and oci8 and the necessary yajra package for laravel to oracle connectivity. The table models were integrated in the framework from the initial projects and when ran
php artisan migrate
the tables were successfully migrated into my database as hopefully expected. However, when running the project and the query is called via laravel controller I get this error:
Yajra \ Pdo \ Oci8 \ Exceptions \ Oci8Exception
With the following error description:
/var/www/laravel/vendor/yajra/laravel-pdo-via-oci8/src/Pdo/Oci8.php
* @param string $dsn
* @param string $username
* @param string $password
* @param array $options
* @param string $charset
* @throws Oci8Exception
*/
private function connect($dsn, $username, $password, array $options, $charset)
{
$sessionMode = array_key_exists('session_mode', $options) ? $options['session_mode'] : null;
if (array_key_exists(PDO::ATTR_PERSISTENT, $options)) {
$this->dbh = @oci_pconnect($username, $password, $dsn, $charset, $sessionMode);
} else {
$this->dbh = @oci_connect($username, $password, $dsn, $charset, $sessionMode);
}
if (! $this->dbh) {
$e = oci_error();
throw new Oci8Exception($e['message']);
}
}
My .env file section for oracle database connectivity is this:
DB_CONNECTION=oracle
DB_HOST=localhost
DB_PORT=1521
DB_DATABASE=orcl
DB_SID_ALIAS=konrms
DB_USERNAME=korms
DB_PASSWORD=Any_password!
DB_CHARSET=AL32UTF8
Is it possible oci8 not to be working as expected? In that case I guess migration would fail... Furthermore I don't know how if it is necessary to add $dsn variable to my .env.