473,397 Members | 1,972 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

php script as a cron job

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
4 1543
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

29
by: deko | last post by:
Is there a way to get my script to run on regularly scheduled intervals without using cron? My hosting provider sucks... cannot use cron... I was thinking perhaps I could create a file every hour...
5
by: deko | last post by:
In regard to running php scripts with cron - Here is a sample script: <?php //debug.php echo "<br> This is a test"; ?> I can call debug.php from a web page on my site like this:
2
by: volantecho | last post by:
hi, i m using webmin to create a cron job of a php script. While i click on 'run it now', it works, generate the output. However, the php script doesnt execute for every minutes which i've set...
10
by: lawrence k | last post by:
I've got a script called makeRss.php. It works fine if I try to open it with my browser. It makes an RSS feed for every page on my site. You can see it working here: ...
3
by: Pol | last post by:
Can php scripts be initiated as a cron jobs running indefinately in a loop performing a task? Any recommendations for writing a php script that will run as an unix server process that will run...
2
by: erikcw | last post by:
Hi all, When trying to run this python script from cron, I get the following error: Traceback (most recent call last): File "/home/lybp/public_html/wa/wa.py", line 14, in ? import MySQLdb...
4
by: J. Frank Parnell | last post by:
Hi there, I have a list of links which point to e.g. thescript.php?album=somePictures1 thescript.php?album=somePictures2 This list is about 3000 links. Each album may have 500 or more...
0
by: Alen192 | last post by:
i have create this simple script i bash that modify the crontab's user's file with an option passed by standard input, now i would know if is possible create a similar script with php so i can...
3
by: uzzi | last post by:
I don't know how to make a php script to work via cron...I want to make it run daily...My server API is CGI/Fast CGI.I have hosting from godaddy and in the help section i found that i have to specify...
7
by: rahismailbox | last post by:
I need to run a script in every 10 seconds in background of the site of 10-15 php pages. So how do i activate that script? Is there a code to be embedded in every php page so that the script got...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.