I'm not expert in php and it my first time trying to connect php with oracle database
I've made mistake before as I was trying to connect to MySQL while I should've connected to oracle instead

Oracle instant client is installed in the uni server and with features static IP and firewall

I tried to place the file in the uni server but I got this error I've been trying to solve this error since 10 am and now it 8 pm I've run out of solutions please HELP!

*Warning: ocilogon(): ORA-12537: TNS:connection closed
Fatal error: Maximum execution time of 30 seconds exceeded
*
and when I place it in WAMPSERVER

I get this error

Fatal error: Call to undefined function OCILogon()

this is my php file

<?php
    $db = "(DESCRIPTION=(ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = name.database.uniName.ac.uk)(PORT = xxxx)))(CONNECT_DATA=(SID=orcl)))" ;

    if($c = OCILogon("student", "student", $db))
    {
        echo 'YEAH connected to Oracle';
        OCILogoff($c);
    }
    else
    {
        $err = OCIError();
        echo 'Connection failed.' . $err[text];
    }
?> 
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.