i can't connect using the following method but if i use tnsnames alias then it works .
$conn = oci_connect('hr', 'welcome', 'localhost/XE');