1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Require() Fatal error. Help!

Discussion in 'PHP' started by valandil, Jan 10, 2009.

  1. #1
    Hey guys,
    SEMrush
    I was running a cron job when I receive an email from cron daemon that says this:

    <br /><b>Fatal error</b>: require() [<a href='function.require'>function.require</a>]: Failed opening required '/home/valandil/public_html/emailmarketer/admin/functions/api/send.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in <b>/home/valandil/public_html/emailmarketer/admin/functions/api/jobs_send.php</b> on line <b>15</b><br />

    Anyone know what's wrong? The cron is for sending emails. I'm still trying it out so I only send it to me. One person.
     
    valandil, Jan 10, 2009 IP
    SEMrush
  2. norbert

    norbert Guest

    Messages:
    61
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Open the file /home/valandil/public_html/emailmarketer/admin/functions/api/jobs_send.php

    Look at line 15

    There is probably a require statement which points to
    /home/valandil/public_html/emailmarketer/admin/functions/api/send.php

    Now, figure out why cron/php cannot open send.php from jobs_send.php.
    Some ideas: wrong paths, wrong permissions, ...
    Also check others logs, like /var/log/messages, cron log
     
    norbert, Jan 11, 2009 IP
  3. valandil

    valandil Peon

    Messages:
    37
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Line 15 says this:

    require_once(dirname(__FILE__) . '/jobs.php');

    I have no idea what's wrong. Is it a wrong path?
     
    valandil, Jan 11, 2009 IP
  4. norbert

    norbert Guest

    Messages:
    61
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Does it work if you execute the cron job directly by root?
     
    norbert, Jan 11, 2009 IP
  5. SiteTalkZone

    SiteTalkZone Peon

    Messages:
    243
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #5
    check jobs.php is there and in the right place. You might need to find out what dirname(_FILE_) points to to do that.
     
    SiteTalkZone, Jan 11, 2009 IP
  6. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,514
    Likes Received:
    1,930
    Best Answers:
    247
    Trophy Points:
    515
    #6
    since it says it's failing trying to call:

    /home/valandil/public_html/emailmarketer/admin/functions/api/send.php

    make sure that file actually exists - AND that it's permissions are set correctly. A good possiblity is that it's got improper 'ownership', in which case I'd chmod the file to 774, but chown it's group to whatever group your *nix flavor uses to run cron jobs. (leaving the owner alone so you can still control it normally web-side)
     
    deathshadow, Jan 11, 2009 IP
  7. valandil

    valandil Peon

    Messages:
    37
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Thanks guys for the help. I've got everything sorted out.
     
    valandil, Jan 11, 2009 IP