php - Cron file working fine in browser but not in command -


i have configured cron job in hostgator. runs web browser fine , works. (https://www.site.com/cron.php) scheduled cron job in hostgator not work of these command... php /home/username/public_html/cron.php or php -q /home/username/public_html/cron.php

here cron.php file. can help?

<?php     require_once ('config_inc.php');       define('_valid_mos_', 1);     set_time_limit(0);     error_reporting(e_all ^ e_notice);     ignore_user_abort(true);     require_once (docspath . 'includes/eg_cron.php');      if (running_from_commandline()){         run_cronfile();         exit;     }     require_once (docspath . 'includes/setting_inc.php');     require_once (_eg_language_dir . $config['language_default']  . "/general.php");     $cron = new egcron();      if ($config['cron_investment']) $cron->cron_deposit();     if ($config['mailqueue_enable'] && $config['cron_mailqueue']) $cron->cron_mailqueue();     if ($config['cron_automail']) $cron->cron_automail();      if ($config['expdays'] && $config['cron_expire']) $cron->cron_expire();     if ($config['cron_pending']) $cron->cron_pending();     if ($config['cron_stats']) $cron->cron_stats();      $cron->log_cron("cron job finished successfully"); ?> 

we faced same issue here alternatives try. in include give full absolute path instead of relative. try using php-cgi instead of php

and enjoy.


Comments

Popular posts from this blog

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -