Title: PHP Warning &#8211; Expected parameter 2 to be an array
Last modified: February 24, 2023

---

# PHP Warning – Expected parameter 2 to be an array

 *  Resolved [Robert](https://wordpress.org/support/users/rsterry48/)
 * (@rsterry48)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/php-warning-expected-parameter-2-to-be-an-array/)
 * Recently received this PHP Log warning:
 * Warning: array_merge(): Expected parameter 2 to be an array, bool given in /home/
   onenameg/public_html/wp/wp-content/plugins/error-log-monitor/Elm/Settings.php
   on line 8
 * Could you please advise if this is anything to worry about?
 * Many thanks
 * Robert

Viewing 13 replies - 1 through 13 (of 13 total)

 *  Plugin Author [Janis Elsts](https://wordpress.org/support/users/whiteshadow/)
 * (@whiteshadow)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/php-warning-expected-parameter-2-to-be-an-array/#post-16502369)
 * Thank you for the report. That’s an unusual error, it sounds like maybe the plugin
   settings have been overwritten with invalid data. Please try this: click the “
   Configure” link in the widget header, then click “Save Changes” in the configuration
   screen (no need to change anything, just save the existing settings).
 *  Thread Starter [Robert](https://wordpress.org/support/users/rsterry48/)
 * (@rsterry48)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/php-warning-expected-parameter-2-to-be-an-array/#post-16504400)
 * Thanks for your advice Janis. Have done as you suggested. Will let you know how
   that goes.
 * Many thanks
   Robert
 *  Thread Starter [Robert](https://wordpress.org/support/users/rsterry48/)
 * (@rsterry48)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/php-warning-expected-parameter-2-to-be-an-array/#post-16506395)
 * Hi Janis
   I tried the fix you suggested and cleared the log. However, the same
   error appeared again the next day:Warning: array_merge(): Expected parameter 
   2 to be an array, string given in /home/onenameg/public_html/wp/wp-content/plugins/
   error-log-monitor/Elm/Settings.php on line 8
 * Should I try something else?
   Many thanksRobert
    -  This reply was modified 3 years, 3 months ago by [Robert](https://wordpress.org/support/users/rsterry48/).
 *  Plugin Author [Janis Elsts](https://wordpress.org/support/users/whiteshadow/)
 * (@whiteshadow)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/php-warning-expected-parameter-2-to-be-an-array/#post-16506867)
 * This error looks slightly different: the first one said `bool given`, while this
   error says `string given`. That suggests some data was loaded from the database,
   but now it’s in the wrong format (or invalid; impossible to say without seeing
   the data).
 * The fact that the plugin is active all the time (presumably), but the error only
   happened again after a day or so, could mean that the error only happens during
   a cron job or another periodic event. Is there anything on your site that could
   affect how settings are loaded from the database during a cron job? Like a caching
   plugin or a filter that chooses which DB prefix (for Multisite) to use depending
   on the environment?
 *  Thread Starter [Robert](https://wordpress.org/support/users/rsterry48/)
 * (@rsterry48)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/php-warning-expected-parameter-2-to-be-an-array/#post-16507938)
 * Thanks very much for getting back Janis. I confirm the plugin runs all the time.
   Let me discuss with others in our little Web Team and get back to you.
 * FYI we’re running WordPress 6.1.1 on Focus Pro Theme using Genesis 3.4.0 and 
   Error Log Monitor 1.7.4
 * With much thanks
 * Robert
 *  Thread Starter [Robert](https://wordpress.org/support/users/rsterry48/)
 * (@rsterry48)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/php-warning-expected-parameter-2-to-be-an-array/#post-16516245)
 * Have discussed with our Web Team [all volunteers] but no one can throw any more
   light on the issue. It may be connected to the upgrade to WP6 that produced a
   lot of PHP cron warning errors that we have never seen before – probably because
   the PHP upgrade made errors visible that previously weren’t reported. We generally
   now ignore these cron errors – without any noticeable impact on the website. 
   Ignoring the error doesn’t always stop the error from appearing. In which case
   we add these errors to ignored regular expressions in the PHP Error Log.
 * However, I notice with this error:
   Warning: array_merge(): Expected parameter
   2 to be an array, string given in /home/onenameg/public_html/wp/wp-content/plugins/
   error-log-monitor/Elm/Settings.php on line 8
 * that when I ignore it and go to Configure, it doesn’t appear in the list of Ignored
   errors. And when I click Cancel, the same error appears again in PHP Error Log.
   I tried this several times with the same result. If I Clear Log, the error remains.
   So I can’t delete it! Very odd behaviour. Hope you can help.
   Cheers Robert
 *  Plugin Author [Janis Elsts](https://wordpress.org/support/users/whiteshadow/)
 * (@whiteshadow)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/php-warning-expected-parameter-2-to-be-an-array/#post-16518901)
 * The ignored errors are stored in the same database entry as other plugin settings.
   Are you able to edit any other settings in the widget configuration? For example,
   if you change the “number of entries to show” field, does that change persist
   if you leave and reopen the configuration screen?
 * I’m asking that to check if there could be a bigger problem where the plugin 
   can’t either load _or_ save settings in some circumstances.
 * Also, is this happening on a regular site or in a Multisite network? There are
   certain database issues that are more common in Multisite, and it’s possible 
   they could affect the plugin this way.
 *  Thread Starter [Robert](https://wordpress.org/support/users/rsterry48/)
 * (@rsterry48)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/php-warning-expected-parameter-2-to-be-an-array/#post-16519688)
 * Thanks Janis for helping with this one. Currently we don’t have anything entered
   in the “number of entries to show” field. So added ’10’ and saved. But when I
   went back to the config screen, it hadn’t saved anything! We’re not using a multi
   site network. Just a regular WP installation. Hope this helps, Robert
 *  Plugin Author [Janis Elsts](https://wordpress.org/support/users/whiteshadow/)
 * (@whiteshadow)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/php-warning-expected-parameter-2-to-be-an-array/#post-16520414)
 * On a regular site, the plugin settings would be saved in the `wp_options` table,
   in an option named `ws_error_log_monitor_settings`. Does this option exist in
   your database? If so, please try deleting it and then changing a setting again.
   Does it save properly now?
 * You could also try checking the `wp_options` table for errors. Most database 
   management tools should have a button or link that does that.
 *  Thread Starter [Robert](https://wordpress.org/support/users/rsterry48/)
 * (@rsterry48)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/php-warning-expected-parameter-2-to-be-an-array/#post-16526842)
 * Found the options table and deleted ws_error_log_monitor_settings. And yes, it’s
   now saving “PHP Warning: array_merge(): Expected parameter 1 to be an array …”
   in Ignored Messages. So the PHP Error Log in Dashboard is now showing no entries.
   Do I need to do anything further at this stage?
 *  Plugin Author [Janis Elsts](https://wordpress.org/support/users/whiteshadow/)
 * (@whiteshadow)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/php-warning-expected-parameter-2-to-be-an-array/#post-16527309)
 * It sounds like it’s working now. But just to be sure, I would recommend this:
   wait a day or two, then un-ignore that warning, and see if any more warnings 
   like that have been logged in the past 24 hours. If not, the problem has probably
   been fixed, and you can add the warning to the ignore list again.
 *  Thread Starter [Robert](https://wordpress.org/support/users/rsterry48/)
 * (@rsterry48)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/php-warning-expected-parameter-2-to-be-an-array/#post-16528637)
 * Thanks heaps Janis. Will do the final test as you suggest. A lot of the cron 
   errors that we previously set to Ignore will probably reappear now as we deleted
   the ELM settings. So will just set to ignore again. So not a problem. Will let
   you know if we have any further problems. But looking good so far. Cheers – Robert
 *  Thread Starter [Robert](https://wordpress.org/support/users/rsterry48/)
 * (@rsterry48)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/php-warning-expected-parameter-2-to-be-an-array/#post-16534529)
 * Hi Janis
   Did final test and unignored error. No new similar errors in past 24
   hours. So ignored again and assume everything ok. Huge thanks for all your help.
   All the best
 * Robert

Viewing 13 replies - 1 through 13 (of 13 total)

The topic ‘PHP Warning – Expected parameter 2 to be an array’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/error-log-monitor.svg)
 * [Error Log Monitor](https://wordpress.org/plugins/error-log-monitor/)
 * [Support Threads](https://wordpress.org/support/plugin/error-log-monitor/)
 * [Active Topics](https://wordpress.org/support/plugin/error-log-monitor/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/error-log-monitor/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/error-log-monitor/reviews/)

 * 13 replies
 * 2 participants
 * Last reply from: [Robert](https://wordpress.org/support/users/rsterry48/)
 * Last activity: [3 years, 3 months ago](https://wordpress.org/support/topic/php-warning-expected-parameter-2-to-be-an-array/#post-16534529)
 * Status: resolved