Web Hosting Forum | Lunarpages
News: Server Migrations to San Diego: Deneb, Felix and Tsohea are moving to San Diego starting Tuesday, December 30, 2008 at 10pm Pacific. They will complete their moves Friday night, January 2, 2009

Isis, Seth and Ez-web-n-mail will move physically on Friday, January 2, 2009

Please see the forum posts at http://www.lunarforums.com/lunarpages_web_hosting_server_information-b54.0/

+ Submit Your Own Web Site for the January 2009 Site of the Month Contest!
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
January 09, 2009, 04:18:18 PM


Login with username, password and session length


Pages: [1]   Go Down
  Print  
Author Topic: Cron Job send error message instead of output on email id  (Read 219 times)
Jasica
Newbie
*
Offline Offline

Posts: 1


« on: March 20, 2008, 11:47:06 PM »

Hello,

I have set Cron Job like this :

Cron output will be send at address :My address

Cron Job for : everyday & every other minute

Command to run : /home/flour5/public_html/cron.php

If I set Cron Job then every other minute I received mail on my email id like this :

/home/flour5/public_html/cron
.php: line 1: ?php
: No such file or directory
/home/flour5/public_html/cron.php: line 2:
: command not found
/home/flour5/public_html/cron.php: line 3: syntax error near unexpected token `('
/home/flour5/public_html/cron.php: line 3: `//echo getcwd();


I don't know how to solve this issue.

Need Help.

Please suggest some solution.

Regards,
Jasica

Logged
MariaP
Support
Spacescooter Operator
*****
Offline Offline

Posts: 44


« Reply #1 on: March 21, 2008, 03:00:09 AM »

Hi,

You might want to add "php -q" in the beginning of your cron job command to let the system know that it will need to use php to run your script:

php -q /home/flour5/public_html/cron.php

Hope this will help.
Logged

skidpics
Spacescooter Operator
*****
Offline Offline

Posts: 30


« Reply #2 on: October 07, 2008, 10:31:07 PM »

Having kinda the same issue, except I get this: /bin/sh: /home/vande11/public_html/PIQUESHARE/Beta/forum/cronrss.php:
> Permission denied


In the docs, it stated putting php before the path, but nothing about -q - What exactly is that for?

I will use what you stated and check it in the am.  if nothing is showing then?

I am trying to run a cron job for RSS feeds for a SMF plugin...  Got it to work once, with a forced cron from the plugin, but not with setting up a job, yet..
Logged
MrPhil
Quantum Encyclopedia Writer
*****
Offline Offline

Posts: 3578



« Reply #3 on: October 08, 2008, 06:14:25 PM »

php -q says to not produce web page headers (quiet). PHP normally assumes that the output is going to a browser, and puts out some headers. Run from a command line, you don't need them.

Your error message seems to indicate that you didn't even put php -- the default processor (shell) is trying to execute a PHP file.
Logged

Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.6 | SMF © 2006-2008, Simple Machines LLC

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM