Skip to content
PHP Logo

What could be causing the "Fatal error: Call to undefined function ora_logon()" in a PHP file?

The error "Fatal error: Call to undefined function ora_logon()" occurs when the PHP script is trying to call a function (ora_logon) that is not defined or available in the current environment. This could be due to missing Oracle Database extensions or libraries in the PHP configuration. To solve this issue, you need to ensure that the Oracle Database extensions are installed and enabled in PHP.

php
// Check if the Oracle Database extension is loaded
if (!extension_loaded('oci8')) {
    die('Oracle Database extension is not loaded. Please enable it in your PHP configuration.');
}

// Your code that uses ora_logon() function