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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T00:30:45+00:00 2026-05-14T00:30:45+00:00

I’ve set up a CRON to call a URL in Kohana 3. php /home/user/public_html/index.php

  • 0

I’ve set up a CRON to call a URL in Kohana 3.

php /home/user/public_html/index.php my/route/in/bootstrap.php

It seems to access the URL fine.

However, I have received this error (send back in an email that my host sends per CRON)

Undefined index:  HTTP_HOST
SYSPATH/classes/kohana/url.php [ 40 ]

Source of url.php

Which is in a Kohana system file. Is this because the CRON job is not sending HTTP headers?

How would I fix this and get it to work (hopefully without hacking the core files).

Or am I doing the CRON wrong?

Update

Pekka provided a good answer, however I’d like to avoid changing the core files (though I will as a last resort).

It would seem Kohana 3 does have support for CLI, as there is a static property $is_cli.

http://github.com/kohana/core/blob/master/classes/kohana/core.php#L54

  • 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-14T00:30:45+00:00Added an answer on May 14, 2026 at 12:30 am

    It seems like you have E_STRICT notification turned on, and Kohana’s error handling catches that. E_STRICT will complain about undefined indexes. The index is indeed undefined because there is no HTTP_HOST in a PHP script when called through the CLI.

    Chances are your script is running fine despite this. You would have to turn down error_reporting at some point to prevent the message from showing up – I don’t know Kohana well enough to know whether you can use a different config file when called from the CLI.

    Maybe just turning down the error_reporting() in your specific controller does the trick, although it’s a bit hacky.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string
this is what i have right now Drawing an RSS feed into the php,
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I need to clean up various Word 'smart' characters in user input, including but
I have an MVC Razor view @{ ViewBag.Title = Index; var c = (char)146;
I'm trying to create an if statement in PHP that prevents a single post

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.