473,503 Members | 2,163 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

cronjob and php problem

5 New Member
Hi
I'm trying to run an scheduled php script using cronniX on mac os x. So far I haven't got much promising results, but i think i'm close to it.

I'm not familiar at all with Terminal and its language syntax so I've been pulling resources from all over the web to figure out what's going on.

The test php script all it does is to write a time stamp on a text file. It works well when I run it manually from localhost. both the php and txt files are set to permission # 777.

Now when I run this as a cronjob i get a series of errors mailed to me. I've tried different options for the cronjob, all of them failing.

If someone with more knowledge on this area could look into this and give me some hints I would really appreciate it. I am sure some of these errors are trivial to you.

Here are my different attempts and the errors mailed:

Expand|Select|Wrap|Line Numbers
  1. *      *       *       *       *       /Users/mauro/Sites/phpTests/croned/croned.php
  2.  
  3. error reported 1:
  4. /Users/mauro/Sites/phpTests/croned/croned.php: line 1: ?PHP: No such file or directory
  5. /Users/mauro/Sites/phpTests/croned/croned.php: line 2: syntax error near unexpected token `('
  6. /Users/mauro/Sites/phpTests/croned/croned.php: line 2: `$date = date("l dS \of Ffclose($printout);'date); xt", "a"); 
  7.  
  8. error reported 2:
  9. /Users/mauro/Sites/phpTests/croned/croned.php: line 1: ?PHP: No such file or directory
  10. /Users/mauro/Sites/phpTests/croned/croned.php: line 2: syntax error near unexpected token `('
  11. fclose($printout);'date); xt", "a"); oned.php: line 2: `$date = date("l dS \of F Y h:i:s A");
  12.  
Expand|Select|Wrap|Line Numbers
  1. *      *       *       *       *       http://localhost/~mauro/phpTests/croned/croned.php
  2.  
  3. error reported
  4. /bin/sh: line 1: http://localhost/~mauro/phpTests/croned/croned.php: No such file or directory
  5.  
Expand|Select|Wrap|Line Numbers
  1. *      *       *       *       *      /usr/bin/php http://localhost/~mauro/phpTests/croned/croned.php
  2.  
  3. error reported
  4. Could not open input file: http://localhost/~mauro/phpTests/croned/croned.php
  5.  
Expand|Select|Wrap|Line Numbers
  1. *      *       *       *       *      /usr/bin/php  /Users/mauro/Sites/phpTests/croned/croned.php
  2.  
  3. doesn't even sent me an email!
  4.  
Feb 4 '08 #1
2 2165
mauricioarango
5 New Member
... and just in case this can be of any use:
Expand|Select|Wrap|Line Numbers
  1. X-Cron-Env: <SHELL=/bin/sh>
  2. X-Cron-Env: <PATH=/usr/bin:/bin>
  3. X-Cron-Env: <LOGNAME=mauro>
  4. X-Cron-Env: <USER=mauro>
  5. X-Cron-Env: <HOME=/Users/mauro>
Feb 4 '08 #2
mauricioarango
5 New Member
this issues was solved here:

http://forums.macosxhints.com/showthread.php?p=448624#post448624
Feb 5 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

117
7102
by: Peter Olcott | last post by:
www.halting-problem.com
28
5170
by: Jon Davis | last post by:
If I have a class with a virtual method, and a child class that overrides the virtual method, and then I create an instance of the child class AS A base class... BaseClass bc = new ChildClass();...
3
1718
by: Mossum | last post by:
Hello, I have a PHP file that reads another PHP file and writes it as a static HTML page. I'd like to run the first PHP file as a cronjob (so that the static HTML page is updated once an hour)....
1
1104
by: Stefan Schwärzler | last post by:
hi ng, is it possible with php to search new content on internet sides with an daily php cronjob? Are there any php-tool (to search and save into xml or databases; and cronjob-tools) available?...
4
2051
by: coool | last post by:
Hi I'm trying to run a cronjob on a php script everything is working fine, but I'm getting my server disk space fulled up - so what's wrong here ??? how can I fix this problem ?
0
1068
by: okonita | last post by:
Hi all, I need to learn how to create a cronjob in a Linux environment. What are the steps necessary to accomplish this. For example, I want to run daily statistics for a set of active/volatile...
6
1825
by: thelevitator | last post by:
Im trying to execute a perl script from a shell script. I have to pass the path of a file in the command line when i execute the perl script (Automate the perl script execution). How do i feed the...
0
1001
by: ecmrd600 | last post by:
I have put my link into cronjob like Entry 1 Command to run: http://www.ecmrd.com/dbiplab/white_...cal_compile.php Minute(s):59 Hour(s): every 1 hr
5
1560
by: Christian Schlemmer | last post by:
Hi, in a webapplication, after a submit a page is called which is processing images uploaded by the user. currently after submit a status bar will be visible (the page for the image processing...
0
7205
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
7287
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7353
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...
1
7011
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7468
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
5596
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
4689
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3180
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3170
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.