The function ora_logon
was a function used in the old days (at the same time) in the PHP4, today we no longer use it, now we use it oci_login
for example, which allows access to 12c, 11g, 10g, 9i and 8i.
Edit the file php.ini
and remove the point and comma from the following line (if windows)
extension=php_oci8_11g.dll
If it is *Nix:
extension=oci8.so
Windows:
- Download the OTN Instant Client page - probably the 32bit, but if it fails and your php is 64bit, maybe you should try it.
- Extract the downloaded file in
C:\instantclient_11_2
- Add the path to System variables (
PATH
)
Start Menu > Control Panel > System & Security > System > Advanced System Settings (or type in Run/cmd SystemPropertiesAdvanced
)
- Look for the button called Environment variables
- Has two areas, User variables and System variables, search in System variables the variable
PATH
and click edit
- Add this at the end (be careful not to delete what you already have)
;C:\instantclient_11_2
The function used to connect used is oci_login
, list of documentation functions http://php.net/manual/en/book.oci8.php
Example of use:
<?php
$conn = oci_connect('hr', 'welcome', 'localhost/XE');
if (!$conn) {
$e = oci_error();
trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
}
$stid = oci_parse($conn, 'SELECT department_id, department_name FROM departments');
oci_execute($stid);
while (($row = oci_fetch_assoc($stid)) != false) {
echo $row['DEPARTMENT_ID'] . " " . $row['DEPARTMENT_NAME'] . "<br>\n";
}
oci_free_statement($stid);
oci_close($conn);
The oracle extension is enabled?
– rray
You are enabled:
extension=php_oci8.dll 
extension=php_oci8_11g.dll 
extension=php_pdo_oci.dll
– Renan AC
You have the documentation link to
ora_logon
only found something related to php4. With oci_connect you can make the connection?– rray