Guides & Tutorials7.2 Update TroubleshootingTroubleshooting An "Oops! strpos(): Empty needle" Error

Troubleshooting An "Oops! strpos(): Empty needle" Error

After updating to version 7.2 you may encounter an "Oops!" error page, and upon enabling Display or Log Errors options, the following stack trace:

strpos(): Empty needle in \whmcs\vendor\whmcs\whmcs-foundation\lib\ClientArea.php:0

This indicates the Error Reporting level in your server's PHP Configuration is too high. There are two places to check:

Elevated Error Reporting Levels - WHMCS

Navigate to Setup > General Settings

Select the Other tab and scroll down to the bottom of the page.

UNtick the Display Errors checkbox

Click Save Changes.

The Display Errors option might also be enabled in the configuration.php file. So it's worth checking there too.

Open the configuration.php file in your WHMCS directory on your server.

Look for the following lines of code and remove them if present:

$display_errors = E_ALL ^ E_NOTICE;
$display_errors = true;

Save the file and upload to the server.

Elevated Error Reporting Levels - Server

If the Display Error options are switched off and you're still seeing warning messages, it indicates the Error Reporting level in your server's PHP Configuration is too high. This is a PHP configuration level issue and therefore for shared or reseller users, may require the assistance of your web hosting provider.

If you have sufficient access and your server is configured to use WHM for administration, follow these steps:

In WHM navigate to Service Configuration >> PHP Configuration Editor >> Advanced

Scroll down to the error_reporting setting:

Change the value to:

E_ALL & ~E_WARNING & ~E_USER_WARNING & ~E_NOTICE & ~E_USER_NOTICE & ~E_STRICT & ~E_DEPRECATED & ~E_USER_DEPRECATED

Click Save.