0

I am trying to schedule a cronjob on my ubuntu server through SSL. I ran the command:

sudo crontab -e

Then once it created a new file for my user, I put :

* * * * *  php /etc/php5/apache2/php.ini /var/www/automation/cronjob_WDYCI_daily.php

at the bottom.

But it is not working... Anyone have an idea what it should be?

ShadowZzz
  • 107
  • 2
  • 1
    I've never seen the php.ini file referenced in that manner. Have you tried running this task via the CLI? – ceejayoz May 01 '13 at 16:25
  • Hi ceejayoz, how should I have referenced the php.ini? also I have never used CLI, mind explaining? – ShadowZzz May 01 '13 at 16:33
  • Usually, you shouldn't need to specify a php.ini location. If you do, it needs to be with the `-c / --php-ini` flag, not just randomly thrown into the line... CLI = command line, just typing your command into your SSH terminal should show you why it isn't working. – ceejayoz May 01 '13 at 16:37

1 Answers1

0

If you want to use a custom php.ini file, you need to use the -c or --php-ini flag.

* * * * *  php --php-ini /etc/php5/apache2/php.ini /var/www/automation/cronjob_WDYCI_daily.php

In most situations, it's not necessary to specify a particular php.ini file.

ceejayoz
  • 32,910
  • 7
  • 82
  • 106
  • Ok thank you! I was attempting it the way I did on my hosted server before. The way you suggested above worked fine. – ShadowZzz May 01 '13 at 23:14