Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7526743
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T03:55:02+00:00 2026-05-30T03:55:02+00:00

Here is my cronjob’s command php /home/toolacct/public_html/index.php cronjob fetch_emails Here is my CodeIgniter cronjob

  • 0

Here is my cronjob’s command

php /home/toolacct/public_html/index.php cronjob fetch_emails

Here is my CodeIgniter cronjob controller

class Cronjob extends CI_Controller {
    function __construct() {
        parent::__construct();
        die($this->input->is_cli_request()?'T':'F');
        $this->load->model('cronjob_model');
    }   

    public function fetch_emails() {
        $this->cronjob_model->fetch_emails();
    }

    public function index_popularity() {
        $this->db->query('CALL update_email_data_popularity()');
    }
}

The cronjob says “F”
Why?


A side note: If I create a function like this

function is_cli_request() {
    return isset($_SERVER['SHELL']);
}

It returns true or false correctly, while CodeIgniter always returns false.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T03:55:03+00:00Added an answer on May 30, 2026 at 3:55 am

    The Input Class Documentation says that $this->input->is_cli_request() uses the STDIN constant to check if its running on the command line.

    Try using the command line version of PHP instead (php-cli), since the STDIN constant doesn’t appear to be set while running the standard PHP executable (php).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am running the following command in cpanel /ramdisk/bin/php5 -q /home#/username/etc/php.ini /home#/username/public_html/sitename/subfolder/twitter.php It is
I am setting my cronjob as: */5 * * * * /usr/local/lib/php /home/..app/webroot/cron_dispatcher.php /devices/checkForAlert
Here's my situation: I'm trying to run a php script via cron, and I've
Here's the problem I'm trying to solve: I have a dynamic php-driven website that
I have a problem in running the cron job. here are my code: <?php
i have a cronjob in php that calculates few business rules (eg: net rev,
i would like some explanations. i have a script <?php //mailing script here ?>
Here's a basic regex technique that I've never managed to remember. Let's say I'm
Here's a problem I ran into recently. I have attributes strings of the form
Here is the issue I am having: I have a large query that needs

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.