Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

cron jobs

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

cron jobs

Postby tiger » Sat Oct 26, 2013 8:52 pm

Hello guys

I have some problems with the cron jobs. I used these two lines in my (cron.txt) file:

Code: Select all
MAILTO=myemail@gmail.com
1 0 * * * * php -f /home/my_user_name/public_html/cron.php


(note: I got this syntax from the web host)
"php -f /home/user_name/public_html/cron.php"


and in my (cron.php) file:

Code: Select all
<?php
$to= "myemail@gmail.com";
$subject = "Cron Job Status";
$from = "myemail@gmail.com";
$message = "The cron job is working fine.";
mail($to,$subject,$from, $message);
?>


and that cron.php file is working fine when I run in via the URL.

but it's not working although the permissions for both files are rwxr-xr-x

I also used the cron jobs function from the web host service, but still did not work..

any suggestion?
tiger
New php-forum User
New php-forum User
 
Posts: 16
Joined: Thu Jun 23, 2011 9:28 pm

Re: cron jobs

Postby johnj » Mon Oct 28, 2013 12:21 am

not working from where...???

schedule another cron job (as a test) and see if it works. If it works, compare these two and figure out what you are doing wrong.
johnj
php-forum Super User
php-forum Super User
 
Posts: 1805
Joined: Thu Mar 10, 2011 5:07 pm

Re: cron jobs

Postby tiger » Mon Oct 28, 2013 12:30 am

the cron.txt does not execute. I asked the webhost and they said they support it, however, when I used the cron jobs from the webhost C-Panal, it still does not work. I told them that, but they still say it's working.

The cron.php file works just fine, and I get email when I go the url of cron.php

So my concern is that is there anything wrong with my cron.txt command OR it is that the webhost actually does not support it?
tiger
New php-forum User
New php-forum User
 
Posts: 16
Joined: Thu Jun 23, 2011 9:28 pm


Return to PHP coding => General

Who is online

Users browsing this forum: No registered users and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.