-2

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.

wyred
  • 217
  • 1
  • 2
  • 7

2 Answers2

1

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)

wyred
  • 217
  • 1
  • 2
  • 7
0

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.