Cron job issue - No direct script access allowed |
Hi, I'm having trouble getting a cron job to run:
===== The file that I need the cron to run is located at: Code: /home/user/public_html/application/modules/cron/controllers/cron.php The command for the cron is: Code: /usr/local/bin/php /home/user/public_html/application/modules/cron/controllers/cron.php Cron index The file cron.php contains: <?php if (!defined('BASEPATH')) exit('No direct script access allowed'); class Cron extends Front_Controller { public function __construct() { parent::__construct(); $this->load->model('cron_model'); } public function index() { $this->check_on_grace_period(); //checks for grace period if passed disable account } } The error after the cron runs is: No direct script access allowed ===== What am I doing wrong? Any help would be amazing, thanks ![]()
Hi,
You need to run the index.php with the controller method param so in your case this should work: /usr/local/bin/php /home/user/public_html/index.php cron index A good decision is based on knowledge and not on numbers. - Plato
(05-27-2017, 10:16 PM)window077 Wrote: Hi, I'm having trouble getting a cron job to run: https://www.codeigniter.com/user_guide/general/cli.html Code: /usr/local/bin/php /home/user/public_html/index.php cron index change cron.php to Cron.php |
Welcome Guest, Not a member yet? Register Sign In |