Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 (http://codeigniter.com/user_guide/general/cli.html):

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
add comment

2 Answers

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
add comment
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
add comment

Your Answer

 
discard

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.