• Resolved fullworks

    (@fullworks)


    Hi,

    I’m wondering if anyone can help with this issue. A shared host provides wp cli pre installed. This seems to work perfectly from command line, but not when installed and run from cron.

    examples of commands used ( which work in shell )

    cd /home/account/public_html;/usr/local/bin/wp --debug --info > /home/logs/wpcron.log 2>&1
    
    source /home/.bash_profile;cd /home/account/public_html;/usr/local/bin/wp --debug --info > /home/logs/wpcron.log 2>&1
    
    PATH = $PATH:/usr/local/bin;export PATH;cd /home/account/public_html;/wp --debug --info > /home/logs/wpcron.log 2>&1
    

    normal debug and info comes out on command line

    but when trigged through cron I get

    PHP Notice:  Undefined index: argv in phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php on line 905
    PHP Warning:  array_slice() expects parameter 1 to be array, null given in phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php on line 905
    PHP Warning:  Invalid argument supplied for foreach() in phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Configurator.php on line 138
    PHP Warning:  Use of undefined constant STDOUT - assumed 'STDOUT' (this will throw an Error in a future version of PHP) in phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/utils.php on line 1057
    PHP Notice:  Undefined index: argv in phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php on line 1024
    PHP Warning:  implode(): Invalid arguments passed in phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php on line 1024
    PHP Notice:  Undefined index: argv in phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php on line 1706
    PHP Notice:  Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php on line 1706
    PHP Warning:  Use of undefined constant STDOUT - assumed 'STDOUT' (this will throw an Error in a future version of PHP) in phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/commands/src/Help_Command.php on line 138
    PHP Warning:  Use of undefined constant STDERR - assumed 'STDERR' (this will throw an Error in a future version of PHP) in phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/commands/src/Help_Command.php on line 139
    PHP Warning:  proc_open(): Descriptor item must be either an array or a File-Handle in phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/utils.php on line 1434
    PHP Warning:  proc_close() expects parameter 1 to be resource, bool given in phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/commands/src/Help_Command.php on line 142
    Content-type: text/html; charset=UTF-8
    

    which are warnings and notices ( not fatal )
    but zero output

    I have googled quite extensively and have not come across anything similar

    Any pointers?

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Help with wp cli and cron’ is closed to new replies.