Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
CLI interface not functioning under cron #984
Hello, I am using CodeIgniter for a rather large commercial application, and I need to run an hourly cron to manage sending some mail. Pretty basic. I was using the bootstrapper posted on the wiki - http://codeigniter.com/wiki/Cron_job_bootstrapper, with the following cron command:
Worked like a charm. Now, I updated to the latest version of CodeIgniter, 2.1.0 and while browsing the documentation, I noticed that the bootstrap script was useless since it seemed to work easier, http://codeigniter.com/user_guide/general/cli.html by just calling
However, this does not work. When printing the output in my email, it just shows the HTML of the landing page, with no error message being displayed. I know it's not some sort of botched session code, since switching back to the old version works great and the proper log files are created by the script.
What's strange is that running this via the CLI through SSH works, and if I remove the security functionality, so does simply accessing site.com/admin/cron, which is strange.
I cannot put my finger on it - could it be a true CI bug, or a problem with crond?
I can't get the CLI to work from ssh console, although the method does work from the URI
I'm executing the command using root user
no error what so ever seen in logs or httpd log or mysql , the test method has very easy email() test function
if i managed to do syntax error into the method, i'll get PHP Parse error printed into the ssh console.
I don't know actually what is the reason.
yes that does happen with CI 2.1.0
I'll create new empty project and check out of my current application, if it works then i must have something in my application that prevents it from working from CLI, although it works pretty well from URI and that is the strange part.
I've had this problem on a server running CentOS + cPanel.
In the command line I can use
I don't know enough to know why it works like that, but maybe this will help someone else who has the same problem.