Welcome Guest, Not a member yet? Register   Sign In
Executing CodeIgniter Cron Job Returns Default Controller/View
#1

[eluser]IanMcQ[/eluser]
Hi there,

I am moving from an Interworx control panel server to a cPanel server. As I have read, some things are different about PHP CLI with cPanel and that the default "php" command cannot be used to execute cron jobs in a controller in CI.

I have tried variations of:

Code:
php /home/myuser/public_html/a/index.php cron process_mass_email_queue

/usr/bin/php-cli /home/myuser/public_html/a/index.php cron process_mass_email_queue

/usr/local/bin/php /home/myuser/public_html/a/index.php cron process_mass_email_queue
and, oddly, they seem to be returning the default view and controller (HTML output) for this app, as if the command line weren't reading the "cron" and "process_mass_email_queue" arguments. Instead, it's just resorting to the default controller/view.

I'm unsure of what might be causing this and want to proceed with setting up my new cron jobs on my cPanel server. Any thoughts or recommendations? Thanks much.
#2

[eluser]XMadMax[/eluser]
Hi,

Remember that index.php recieve params with argc argv, instead of URL segments, GET or POST.

I allways use a script to emulate http call, then the output it's ever the same as expected in a browser.

Try: http://www.phpclasses.org/package/8097-P...-line.html

#3

[eluser]IanMcQ[/eluser]
XMadMaxX,

I'm referring to this here:

http://ellislab.com/codeigniter/user-gui...l/cli.html
#4

[eluser]waynusanus[/eluser]
Hi, did you ever find a solution? I'm having the same problem




Theme © iAndrew 2016 - Forum software by © MyBB