'Laravel dosen't connect with Oracle

I'm using yajra/laravel-oci8 for Oracle connection with laravel. But I couldn't connected to Oracle, from my client PC to Server.

showing this error: enter image description here

I'm using this code in database.php:

'oracle' => array(
       'driver' => 'oracle',
       'host' => '192.168.152.189',// this is my server IP
       'port' => '1521',
       'database' => 'ocp',
       'username' => 'ocpl',
       'password' => '123456',
       'charset' => 'AL32UTF8',
       'prefix' => '',
       'port' => 1521
  ),

But I'm connected with Sql Developer. see the Sql-Developer Property: enter image description here



Solution 1:[1]

problem in this line : 'database' => 'ocp' , solve it with : 'database' => 'orcl' , or

'database' => '192.168.152.189/orcl'

Solution 2:[2]

Try this

'oracle' => array(
       'driver' => 'oracle',
       'tns' => '(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.152.189)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = orcl)))',
       //'host' => '192.168.152.189',// this is my server IP
       //'port' => '1521',
       'database' => '',
       'username' => 'ocpl',
       'password' => '123456',
       'charset' => 'AL32UTF8',
       'prefix' => '',
),

Solution 3:[3]

Although this question has been posted after almost three year... but I just use this way to solve this problem

search this command in oracle

Select instance_name from v$instance;

then paste the value into 'database' setting

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Md. Jahir Alam Raju
Solution 2 ɢʀᴜɴᴛ
Solution 3 W Kenny