Latest

Monday, July 10, 2017

Oci8Exception in Oci8.php (line 460)

Asked by: fengnan


I met a problem when i use laravel 5.4 to connect to oracle, it will throw the error like this, i googled for days, but can't solve the problem, i don't know where i did wrong, i need your help.

(1/1) Oci8Exception
in Oci8.php (line 460)
at Oci8->connect('(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.2.98)(PORT = 1521)) (CONNECT_DATA =(SID = fanhua)))', 'tianhengrd', 'tianheng123', array(2, 0, 2, 'charset' => 'AL32UTF8'), 'AL32UTF8')
in Oci8.php (line 78)
at Oci8->__construct('(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.2.98)(PORT = 1521)) (CONNECT_DATA =(SID = fanhua)))', 'tianhengrd', 'tianheng123', array(2, 0, 2, 'charset' => 'AL32UTF8'))
in OracleConnector.php (line 204)
at OracleConnector->createConnection('(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.2.98)(PORT = 1521)) (CONNECT_DATA =(SID = fanhua)))', array('driver' => 'oracle', 'tns' => '', 'host' => '192.168.2.98', 'port' => '1521', 'database' => 'fanhua', 'username' => 'tianhengrd', 'password' => 'tianheng123', 'charset' => 'AL32UTF8', 'prefix' => '', 'prefix_schema' => '', 'options' => array(2)), array(2, 0, 2, 'charset' => 'AL32UTF8'))
in OracleConnector.php (line 35)
at OracleConnector->connect(array('driver' => 'oracle', 'tns' => '', 'host' => '192.168.2.98', 'port' => '1521', 'database' => 'fanhua', 'username' => 'tianhengrd', 'password' => 'tianheng123', 'charset' => 'AL32UTF8', 'prefix' => '', 'prefix_schema' => '', 'options' => array(2)))
in Oci8ServiceProvider.php (line 48)
at Oci8ServiceProvider->Yajra\Oci8\{closure}(array('driver' => 'oracle', 'tns' => '', 'host' => '192.168.2.98', 'port' => '1521', 'database' => 'fanhua', 'username' => 'tianhengrd', 'password' => 'tianheng123', 'charset' => 'AL32UTF8', 'prefix' => '', 'prefix_schema' => '', 'options' => array(2)), 'fanhua')
at call_user_func(object(Closure), array('driver' => 'oracle', 'tns' => '', 'host' => '192.168.2.98', 'port' => '1521', 'database' => 'fanhua', 'username' => 'tianhengrd', 'password' => 'tianheng123', 'charset' => 'AL32UTF8', 'prefix' => '', 'prefix_schema' => '', 'options' => array(2)), 'fanhua')
in DatabaseManager.php (line 113)
at DatabaseManager->makeConnection('fanhua')
in DatabaseManager.php (line 71)
at DatabaseManager->connection('fanhua')
in Model.php (line 1041)
at Model::resolveConnection(null)
in Model.php (line 1007)
at Model->getConnection()
in Model.php (line 855)
at Model->newBaseQueryBuilder()
in Model.php (line 814)
at Model->newQueryWithoutScopes()
in Model.php (line 798)
at Model->newQuery()
in OracleUserProvider.php (line 25)
at OracleUserProvider->retrieveByCredentials(array('username' => 'admin', 'password' => '123456'))
in SessionGuard.php (line 352)
at SessionGuard->attempt(array('username' => 'admin', 'password' => '123456'), false)
in AuthenticatesUsers.php (line 76)
at LoginController->attemptLogin(object(Request))
in AuthenticatesUsers.php (line 41)
at LoginController->login(object(Request))
at call_user_func_array(array(object(LoginController), 'login'), array(object(Request)))
in Controller.php (line 55)
at Controller->callAction('login', array(object(Request)))
in ControllerDispatcher.php (line 44)
at ControllerDispatcher->dispatch(object(Route), object(LoginController), 'login')
in Route.php (line 203)
at Route->runController()
in Route.php (line 160)
at Route->run()
in Router.php (line 574)
at Router->Illuminate\Routing\{closure}(object(Request))
in Pipeline.php (line 30)
at Pipeline->Illuminate\Routing\{closure}(object(Request))
in RedirectIfAuthenticated.php (line 24)
at RedirectIfAuthenticated->handle(object(Request), object(Closure))
in Pipeline.php (line 148)
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing\{closure}(object(Request))
in SubstituteBindings.php (line 41)
at SubstituteBindings->handle(object(Request), object(Closure))
in Pipeline.php (line 148)
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing\{closure}(object(Request))
in ShareErrorsFromSession.php (line 49)
at ShareErrorsFromSession->handle(object(Request), object(Closure))
in Pipeline.php (line 148)
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing\{closure}(object(Request))
in StartSession.php (line 64)
at StartSession->handle(object(Request), object(Closure))
in Pipeline.php (line 148)
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing\{closure}(object(Request))
in AddQueuedCookiesToResponse.php (line 37)
at AddQueuedCookiesToResponse->handle(object(Request), object(Closure))
in Pipeline.php (line 148)
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing\{closure}(object(Request))
in EncryptCookies.php (line 59)
at EncryptCookies->handle(object(Request), object(Closure))
in Pipeline.php (line 148)
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing\{closure}(object(Request))
in Pipeline.php (line 102)
at Pipeline->then(object(Closure))
in Router.php (line 576)
at Router->runRouteWithinStack(object(Route), object(Request))
in Router.php (line 535)
at Router->dispatchToRoute(object(Request))
in Router.php (line 513)
at Router->dispatch(object(Request))
in Kernel.php (line 176)
at Kernel->Illuminate\Foundation\Http\{closure}(object(Request))
in Pipeline.php (line 30)
at Pipeline->Illuminate\Routing\{closure}(object(Request))
in TransformsRequest.php (line 30)
at TransformsRequest->handle(object(Request), object(Closure))
in Pipeline.php (line 148)
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing\{closure}(object(Request))
in TransformsRequest.php (line 30)
at TransformsRequest->handle(object(Request), object(Closure))
in Pipeline.php (line 148)
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing\{closure}(object(Request))
in ValidatePostSize.php (line 27)
at ValidatePostSize->handle(object(Request), object(Closure))
in Pipeline.php (line 148)
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing\{closure}(object(Request))
in CheckForMaintenanceMode.php (line 46)
at CheckForMaintenanceMode->handle(object(Request), object(Closure))
in Pipeline.php (line 148)
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing\{closure}(object(Request))
in Pipeline.php (line 102)
at Pipeline->then(object(Closure))
in Kernel.php (line 151)
at Kernel->sendRequestThroughRouter(object(Request))
in Kernel.php (line 116)
at Kernel->handle(object(Request))
in index.php (line 53)

my env file is like this, and my database.php is below,

ORACLE_DB_TNS=
ORACLE_DB_HOST=192.168.2.98
ORACLE_DB_PORT=1521
ORACLE_DB_DATABASE=fanhua
ORACLE_DB_USERNAME=tianhengrd
ORACLE_DB_PASSWORD=tianheng123
ORACLE_DB_PREFIX=
ORACLE_DB_SCHEMA_PREFIX=


'fanhua' => [
            'driver'        => 'oracle',
            'tns'           => env('ORACLE_DB_TNS', ''),
            'host'          => env('ORACLE_DB_HOST', ''),
            'port'          => env('ORACLE_DB_PORT', '1521'),
            'database'      => env('ORACLE_DB_DATABASE', ''),
            'username'      => env('ORACLE_DB_USERNAME', ''),
            'password'      => env('ORACLE_DB_PASSWORD', ''),
            'charset'       => env('ORACLE_DB_CHARSET', 'AL32UTF8'),
            'prefix'        => env('ORACLE_DB_PREFIX', ''),
            'prefix_schema' => env('ORACLE_DB_SCHEMA_PREFIX', ''),
            'options' => [
                PDO::ATTR_CASE         => PDO::CASE_LOWER,
            ]
        ],



Source

No comments:

Post a Comment

Adbox