SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Zealot santanu's Avatar
    Join Date
    Oct 2003
    Location
    india
    Posts
    138
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Cron does not working

    I set my php script at cron tab but it does not wrking properly.

    I set the cron in 4 ways

    1. /path/test.php

    2. wget http://www.xxx.com/test.php

    3. php -f /path/test.php or php -q /path/test.php

    4. lynx -dump http://www.xxx.com/test.php

    After execution of each cron job i get this type of mail

    1. /path/test.php: cannot open ?: No such file or directory

    2. wget: not found

    3. php: not found

    4. lynx: not found

    code of test.php is:

    PHP Code:

     $time
    =date('Y-m-d H:i:s');

    mail('santanu@yahoo.com''testing cron'$time,  
                            
    "MIME-Version: 1.0\r\n".
                            
    "Content-type: text/html; charset=iso-8859-1\r\n".
                            
    "From: <admin@xxx.com>\r\n".
                            
    "CC: yy@yahoo.com\r\n".                
                            
    "X-Mailer: PHP/" phpversion()); 

    I set cron job for many time in different server. But in this case I unable to run cron job. I can't understand the actual reason.

  2. #2
    SitePoint Addict timvw's Avatar
    Join Date
    Jan 2005
    Location
    Belgium
    Posts
    354
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Basically, cron does work since you get an error message...

    The problem is that the user under which the commands are executed does not find 'php', 'wget', ... in his path... The easiest solution is to provide the complete path...

    Verify on your machine where wget, or whatever executable, is located and use the absolute path.. eg: instead of wget use /usr/bin/wget

  3. #3
    SitePoint Zealot santanu's Avatar
    Join Date
    Oct 2003
    Location
    india
    Posts
    138
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes you are right

    Cron is working . That's why i am getting error message. Byt mail is not delivered to the 'santanu@yahoo.com'. My script is correct. and i set the root path at cron tab.

    Can you tell me how can i know that where wget is installed at my server?

  4. #4
    SitePoint Zealot santanu's Avatar
    Join Date
    Oct 2003
    Location
    india
    Posts
    138
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is anybody here who can slove this problem!!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •