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 5987303
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T22:47:43+00:00 2026-05-22T22:47:43+00:00

I am trying to create a cron job while taking advantage of my current

  • 0

I am trying to create a cron job while taking advantage of my current CI setup and the use of Controllers and Models. I am using Cron Bootstrapper (http://codeigniter.com/wiki/Cron_job_bootstrapper/) because it gives me easy access to test the process locally on-demand or be available as a traditional cron process on a server. I can reach the controller using the bootstrapper file and the command line, however, I am getting many different error messages or alerts depending on how I set up my controller.

If I keep the controller as it should be with parent::Controller();, I get the following message:

Unable to connect to your database server using the provided settings.

The error is coming from the DB_driver.php initialize() method.

If I remove the call to parent::Controller() from the controller then I get the following alert:

    <p>Severity: Warning</p>
    <p>Message:  date(): It is not safe to rely on the system's timezone settings. You
       are *required* to use the date.timezone setting or the
       date_default_timezone_set() function. In case you used any of those
       methods and you are still getting this warning, you most likely misspelled
       the timezone identifier. We selected 'America/New_York' for
       'EDT/-4.0/DST' instead</p>
    <p>Filename: htdocs/cron.php</p>
    <p>Line Number: 122</p>`

By removing the parent::Controller(); I am not able to access any models via $this->load->model('model'); and I get the following message:

Fatal error: Call to a member function model() on a non-object in /Applications/MAMP/htdocs/my_site/system/application/controllers/cron.php on line 9

Any info that will allow me to use the bootstrapper file with CI will be very helpful.

  • 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-22T22:47:44+00:00Added an answer on May 22, 2026 at 10:47 pm
    1. Set $db[‘default’][‘db_debug’] = TRUE; in your database config file to enable more verbose error reporting.

    2. You need to heed the timezone warning and set a default in your php.ini file. This is a new requirement as of PHP 5.3. If you are running on a shared server and do not have access to php.ini, you can either request that your web host set a default value, or you can try setting it manually using ini_set() at the top of your bootstrap file.

    3. Check and see if your database config file is being loaded, and if so, double-check your database connection settings. If the settings are right, there could be a firewall blocking you, or the database user you are connecting with might not have permission to access the database you are trying to use.

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

Sidebar

Related Questions

I am trying to setup an end-of-day automated email using a CRON job. I
I am trying to setup a CRON job using PHP, but am not having
I'm trying to create a cron job which will automatically delete .jpg files from
Im trying to create a cron job involving aggregating emails sent within a period.
I'm trying to create a cron job that will send a weekly newsletter. I
I'm trying create a bot which automatically likes Facebook posts. Using Mechanize I can
Ok so I am trying create a login script, here I am using PHP5
Trying to create several layers of folders at once C:\pie\applepie\recipies\ without using several different
Trying to create a small monitor application that displays current internet usage as percentage
I am trying create alert dailog using glade,but its not working .am i doing

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.