By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,946 Members | 712 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,946 IT Pros & Developers. It's quick & easy.

php script as a cron job

P: n/a
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 <?php
?braces.

Is it really the case that there is a configuration that will not allow
output outside the braces?
Jan 2 '08 #1
Share this Question
Share on Google+
4 Replies


P: n/a
On Wed, 02 Jan 2008 23:52:36 +0100, Paul Lautman
<pa**********@btinternet.comwrote:
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
<?php
?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
Jan 2 '08 #2

P: n/a
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).
Jan 2 '08 #3

P: n/a
On Jan 2, 5:52 pm, "Paul Lautman" <paul.laut...@btinternet.comwrote:
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 <?php
?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
Jan 2 '08 #4

P: n/a
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 <?php
?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 <an*******@freemail.ru>

Jan 15 '08 #5

This discussion thread is closed

Replies have been disabled for this discussion.