php cron error

Discussion in 'PHP' started by tandiono, Dec 10, 2007.

  1. #1
    I was trying to get the cron running on the following .php code :

    $root = $_SERVER["DOCUMENT_ROOT"];
    require_once("open/test.php");

    and i got this error :


    Warning: require_once(open/test.php) [[1]function.require-once]:
    failed to open stream: No such file or directory in
    /home/test/public_html/open/test.php on line 4 Fatal error:
    require_once() [[2]function.require]: Failed opening required
    'open/test.php'(include_path='.:/usr/lib/php:/usr/local/lib/php')in
    /home/test/public_html/open/test.php.php on line 4


    Can anyone please kindly help me on that php code please. Thanks


    Best Regards,
    Tandiono
     
    tandiono, Dec 10, 2007 IP
  2. Gawk

    Gawk Peon

    Messages:
    427
    Likes Received:
    36
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Can you post what you have in your cron for the command that calls this.
     
    Gawk, Dec 10, 2007 IP
  3. tandiono

    tandiono Well-Known Member

    Messages:
    353
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    105
    #3
    tandiono, Dec 10, 2007 IP
  4. Gawk

    Gawk Peon

    Messages:
    427
    Likes Received:
    36
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Does running http://www.example.com/open/test.php from a web browser work?
     
    Gawk, Dec 10, 2007 IP
  5. Gawk

    Gawk Peon

    Messages:
    427
    Likes Received:
    36
    Best Answers:
    0
    Trophy Points:
    0
    #5
    You might try to put the entire path to the required file...

    require_once("/the/entire/path/to/open/test.php");
    PHP:
     
    Gawk, Dec 10, 2007 IP