Hide error logs in OpenEMR

Dear Sir/Madam
Hi. I receive a lot of error logs in my OpenEMR but I do not know how to hide them. For instance one could see this above one encounter:
Warning: Trying to access array offset on value of type bool in C:\xampp\htdocs\openemr\src\Common\Acl\AclMain.php on line 367 strong text

I’m using OpenEMR version: 7.0.2 (3)

I’m using: Firefox

I’m using: Windows 64

Kind regards
Mehrshad Koleini

Got it — you are asking two things clearly:

(1) How to hide error logs in OpenEMR (don’t show them on the web page)

(2) How to solve the error Warning: Trying to access array offset on value of type bool in AclMain.php

You are using OpenEMR 7.0.2 (Patch 3) on Windows + XAMPP.

Let’s solve both properly:

:white_check_mark: 1. How to Hide PHP Errors/Warnings in OpenEMR

Solution:

You need to turn off error display in your XAMPP PHP settings (php.ini).

Follow these exact steps:

Step 1: Open your php.ini file

Go to your XAMPP folder:
➔ C:\xampp\php\php.ini

Open it with Notepad or any editor.

Step 2: Change these two settings

Search inside php.ini for:

display_errors

and change:

display_errors = Off

Then search for:

error_reporting

and set:

error_reporting = E_ALL & ~E_WARNING & ~E_NOTICE & ~E_DEPRECATED

:white_check_mark: This hides warnings, notices, and deprecated messages — only real fatal errors will still log.

Step 3: Restart Apache (important)

Open your XAMPP Control Panel

Click Stop on Apache, then Start again.

Now, OpenEMR will NOT show warnings or errors anymore on the web page.

:white_check_mark: 2. How to Properly Solve the AclMain.php Warning

You are seeing:

Warning: Trying to access array offset on value of type bool in C:\xampp\htdocs\openemr\src\Common\Acl\AclMain.php on line 367

:arrow_right: Root cause:
sqlQuery(…) function returned false, but code tried to access it like an array $data[‘something’].

:white_check_mark: Fix: Add an is_array() check before accessing the array.

Here is the general fix:

Open this file:

C:\xampp\htdocs\openemr\src\Common\Acl\AclMain.php

Find around line 367 code like:

$aclData = sqlQuery("SELECT … ");

$access = $aclData[‘access_level’];

:arrow_right: Change it like this:

$aclData = sqlQuery(“SELECT …”);

if ($aclData && is_array($aclData)) {

$access = $aclData['access_level']; 

} else {

$access = null; // or set safe default 

}

:white_check_mark: This will prevent the warning, because now it checks if $aclData is really an array before trying to use it.

:fire: If you want even FASTER solution without changing OpenEMR core:

Only hide warnings globally (via php.ini) as I explained above.

But recommended: fix the AclMain.php code (especially if you plan to move to production).

Final Summary for You

Problem

Solution

Warnings showing on web page

display_errors = Off + error_reporting = E_ALL & ~E_WARNING & ~E_NOTICE & ~E_DEPRECATED

Actual code mistake in AclMain.php

Add if ($result && is_array($result)) { … } check

May, It’s works, If you need any clarification you access our experts.

Dear Qiaben Health
How good and detailed description you gave to me. You know that I am so elementary in this field. PHP error solving worked fine, but I was not able to find any code like $aclData = sqlQuery("SELECT … "); and so on in AclMain.php.
Thank you again