• JD

    (@jutta0303)


    Hi,

    I’ve started seeing the following PHP warnings on my website:

    [17-Aug-2017 06:13:32 UTC] PHP Warning:  date() expects parameter 2 to be long, string given in phar:///opt/wp-cli/bin/wp/php/commands/cron-event.php on line 359
    [17-Aug-2017 06:13:32 UTC] PHP Warning:  date() expects parameter 2 to be long, string given in phar:///opt/wp-cli/bin/wp/php/commands/cron-event.php on line 360
    [17-Aug-2017 06:13:32 UTC] PHP Warning:  date() expects parameter 2 to be long, string given in phar:///opt/wp-cli/bin/wp/php/commands/cron-event.php on line 359
    [17-Aug-2017 06:13:32 UTC] PHP Warning:  date() expects parameter 2 to be long, string given in phar:///opt/wp-cli/bin/wp/php/commands/cron-event.php on line 360
    [17-Aug-2017 06:14:42 UTC] PHP Warning:  Illegal string offset 'args' in phar:///opt/wp-cli/bin/wp/php/commands/cron-event.php on line 392
    [17-Aug-2017 06:14:42 UTC] PHP Warning:  Illegal string offset 'schedule' in phar:///opt/wp-cli/bin/wp/php/commands/cron-event.php on line 393
    [17-Aug-2017 06:14:42 UTC] PHP Warning:  Illegal string offset 'args' in phar:///opt/wp-cli/bin/wp/php/commands/cron-event.php on line 392
    [17-Aug-2017 06:14:42 UTC] PHP Warning:  Illegal string offset 'schedule' in phar:///opt/wp-cli/bin/wp/php/commands/cron-event.php on line 393

    I’ve never used wp-cli so I have no idea what to do with these warnings. I’d like to troubleshoot them though because I’m getting a massive amount of them every hour and my PHP error log just gets way too large way too quickly.

    Thanks for any thoughts/help you can provide and any suggestions for where I can get help for this (if not here).

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi JD,

    What is the output if you run the command wp cron event list ? I have seen this error occur with theme or plugin functions that incorrectly set cron events such as below:


    | 1424523454 | | now | Non-repeating |
    | 1424523454 | | now | Non-repeating |
    | 1424523454 | | now | Non-repeating |
    | 1424523454 | | now | Non-repeating |

    A hook should be displayed for these rather than a string of numbers:


    | wp_version_check | 2017-05-04 09:12:26 | now | 12 hours |
    | wp_update_plugins | 2017-05-04 09:12:26 | now | 12 hours |
    | wp_update_themes | 2017-05-04 09:12:26 | now | 12 hours |

    Does the error occur while using the default theme with all plugins disabled?

    You will also want to make sure WordPress core, along with all themes and plugins have been updated to their latest versions.

    Cheers!

    • This reply was modified 7 years, 6 months ago by colemanedwards. Reason: code block edit
    Thread Starter JD

    (@jutta0303)

    Hi colemanedwards,

    Could you tell me where I run the command you provided? As I said, I’m not familiar with the WordPress commandline, nor have I ever used this functionality.

    Thanks so much!!

    WordPress doesn’t come with the WP-CLI by default. It would have to be installed using the instructions found here: https://wp-cli.org/ or provided by your webhost.

    In order to run commands you would need to create an ssh connection to your server using terminal in Mac/Linux or an application like PuTTY in Windows https://www.putty.org/ . Your webhost should be able to assist you with how to make an ssh connection to your site.

    From there you would simply type the command and press enter to execute.

    Honestly though, you may not need to do any of that and simply disable each plugin or theme one by one until the error messages stop being generated. You’ll know it’s a plugin or theme issue if you disable all of the plugins and set the theme to default which should stop the errors.

    Using process of elimination you can determine which plugin is to blame, or if it is the theme.

    Thread Starter JD

    (@jutta0303)

    Thanks! That was very helpful actually. It seems like it has something to do with my theme (Divi, made by Elegant Themes)… I’ll check in with Elegant around this ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘PHP warnings related to wp-cli’ is closed to new replies.