Welcome Guest, Not a member yet? Register   Sign In
Cronjob outputs welcome message [SOLVED]
#1

(This post was last modified: 12-30-2016, 09:22 AM by Wouter60.)

My webhosting (strato.de) supports the use of cronjobs.
I have a controller named Taskplanner, and a method named Test.
The only thing this method does is:
PHP Code:
echo "This is a test!"

My website is inside a folder on the hosting platform, let's say testwebsite.
The cronjob command is set up like this:
Code:
/bin/php -f ./testwebsite/index.php taskplanner test

I received an e-mail when the cronjob was executed.
Instead of "This is a test!" it contains the complete ouput of my welcome page (from my default controller, NOT from Taskplanner), including all html code, starting with "<!DOCTYPE html> and ending with </html>
In between, I see the html header where css and Javascript were loaded. This caused some error messages, which are also displayed. At the end, there's a database error because my session library tries to write the IP-address into the database. But due to the type of request, there is no IP-address.

What's going wrong here? I believe I set up the cronjob according to the CI documentation, but apparently, I'm making some mistake. Anyone else who is a STRATO customer and has successfully set up cronjobs for CodeIgniter? STRATO can't help me. They say the cronjob function works the way it was designed. Calling a plain php script will work OK. But I don't want to fall back to traditional php scripts and miss all the good stuff CodeIgniter provides.

Any help would be appreciated.
Reply


Messages In This Thread
Cronjob outputs welcome message [SOLVED] - by Wouter60 - 12-23-2016, 07:35 AM
RE: Cronjob outputs welcome message - by Wouter60 - 12-24-2016, 11:48 AM
RE: Cronjob outputs welcome message - by Wouter60 - 12-25-2016, 05:21 AM
RE: Cronjob outputs welcome message - by Wouter60 - 12-25-2016, 11:38 AM
RE: Cronjob outputs welcome message - by Wouter60 - 12-26-2016, 04:41 AM
RE: Cronjob outputs welcome message - by Wouter60 - 12-26-2016, 01:29 PM
RE: Cronjob outputs welcome message - by Wouter60 - 12-30-2016, 03:17 AM
RE: Cronjob outputs welcome message - by Wouter60 - 12-30-2016, 05:48 AM



Theme © iAndrew 2016 - Forum software by © MyBB