I set a scheduler in IIS7, I give the path to php and my URL to run as argument.
The PHP path is C:\php\php.exe
and the argument is -C:\domain.com\usage\index.php
. The site is working with CodeIgniter, and the application folder path and the controller name and function to be called is set in index.php
.
But when running the scheduler, I cannot get the output. I tried to echo test value before the controller class is loaded, I got the value but after that I cannot get anything and scheduler process is exit.
CodeIgniter (and other php frameworks) working with a router. So, you can not run index.php without "Controller/Action/Parameters" request.
the best way to call CI controller from command line is :
C:\php\php.exe -C:\domain.com\usage\index.php controller action
please read more from : http://ellislab.com/codeigniter/user-guide/general/cli.html
The issue is due to the path to php.exe in the scheduler settings.I resolved the issue by changing 'C:\php\php.exe' to 'php' .Then it is working.