Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a PHP web app on Justhost (webhosting provider).

This PHP web app uses the Codeigniter framework.

To run cron jobs on this web app (

php /home/user/path_to_file/index.php cron daily

It works on my development laptop, MacOSX. But the results of the cron job emailed to me indicate that the default login page was executed. The web app could not detect the arguments passed in.

Is there something wrong with the way I wrote the command for a cron job?

I can use wget as a workaround but only as a last resort.

share|improve this question

you really need to confer with your hosting company. From what you have listed there isn't really any way to know if what you have will work, without you knowing what your hosting company allows. Ask them about php configuration, php calls using exec(), other higher level php calls, running crons, etc. You really have to find what things they allow, and maybe a lot more.

share|improve this answer
up vote 0 down vote accepted

Fixed it.

It seems that I cannot use alias(?)

Instead of: php /path_to_file/index.php cron hourly (which doesn't work because the arguments aren't passed into the php file)

I have to use: /usr/local/bin/php /path_to_file/index.php cron hourly (which works. the php file gets the arguments)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.