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:
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
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.
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
Root cause:
sqlQuery(…) function returned false, but code tried to access it like an array $data[‘something’].
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’];
Change it like this:
$aclData = sqlQuery(“SELECT …”);
if ($aclData && is_array($aclData)) {
$access = $aclData['access_level'];
} else {
$access = null; // or set safe default
}
This will prevent the warning, because now it checks if $aclData is really an array before trying to use it.
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.