php script as a cron job
am 02.01.2008 23:52:36 von Paul Lautman
I have a simple script that has been running as a cron job for about 2
years. Recently my hosting company moved to new servers and now the job does
not run.
They have said that "The server configuration is newer and your script will
not run as it's a PHP file which contains some HTML."
By this I think they mean that there is some HTML output outside the
?> braces.
Is it really the case that there is a configuration that will not allow
output outside the braces?
Re: php script as a cron job
am 03.01.2008 00:10:38 von luiheidsgoeroe
On Wed, 02 Jan 2008 23:52:36 +0100, Paul Lautman
wrote:
> I have a simple script that has been running as a cron job for about 2
> years. Recently my hosting company moved to new servers and now the job
> does
> not run.
>
> They have said that "The server configuration is newer and your script
> will
> not run as it's a PHP file which contains some HTML."
>
> By this I think they mean that there is some HTML output outside the
>
> ?> braces.
>
> Is it really the case that there is a configuration that will not allow
> output outside the braces?
No, it's not. It depends on how you call the cron job though...
--
Rik Wasmus
Re: php script as a cron job
am 03.01.2008 00:31:09 von Dikkie Dik
> Is it really the case that there is a configuration that will not allow
> output outside the braces?
No. In fact:
#!/usr/bin/php
Just some plain text
Will run just fine (and show the plain text line).
Re: php script as a cron job
am 03.01.2008 00:46:53 von faulkes
On Jan 2, 5:52 pm, "Paul Lautman" wrote:
> They have said that "The server configuration is newer and your script will
> not run as it's a PHP file which contains some HTML."
>
> By this I think they mean that there is some HTML output outside the
> ?> braces.
>
> Is it really the case that there is a configuration that will not allow
> output outside the braces?
Step 1: Find someone in the support department.
Step 2: Slap them very hard.
Step 3: Check the output of your command from however it is called
from cron
Step 4: man crontab
Step 5. Profit
Re: php script as a cron job
am 15.01.2008 22:56:20 von AnrDaemon
Greetings, Paul Lautman.
In reply to Your message dated Thursday, January 3, 2008, 01:52:36,
> I have a simple script that has been running as a cron job for about 2
> years. Recently my hosting company moved to new servers and now the job does
> not run.
> They have said that "The server configuration is newer and your script will
> not run as it's a PHP file which contains some HTML."
It's most silly answer I have heard. And it is nominated as the siliest one in
the started year. What a shame!
> By this I think they mean that there is some HTML output outside the
> ?> braces.
It's not a problem for PHP itself.
> Is it really the case that there is a configuration that will not allow
> output outside the braces?
No.
Please check the way You are using to start Your crontab job.
Basically, it should contain a string like:
/usr/local/bin/php -f /home/username/path/jobfile.php
Some companies configure crontab to send any output generated by user
jobs back to the user's email.
If You do not want to flood Your email address from crontab output, make sure
Your job does not output anything except error messages.
--
Sincerely Yours, AnrDaemon