Skip Navigation
Expand
PHP fatal error: Access to file_exists is denied because its trying to access restricted folders
Answer ID 12700   |   Last Review Date 09/19/2023

How do we fix 500 errors from PHP customizations after updating to version 23C?

Environment:
  • Oracle B2C Service version 23C
  • PHP customizations in Customer Portal (any version)
  • PHP customizations in the custom scripts directory
Issue:
We upgraded to version 23C of Oracle B2C Service and now are getting errors on contact login.
 
Resolution:
Changed some code in a custom library from this:
$filepath = get_cfg_var("doc_root") . "/ConnectPHP/Connect_init.php";
if (!file_exists($filepath)) {
    throw new \Exception("Did not load Connect API.");
}
require_once $filepath;
To this:
require_once get_cfg_var("doc_root") . "/ConnectPHP/Connect_init.php";
 
Cause:
In this case, the login flow hooked a custom model, which loaded a library containing the affected code snippet. We found a fatal PHP error in the trace, "Access to file_exists is denied because its trying to access restricted folders." file_exists cannot access the directory in question, so it was removed from the custom code.