mail_cron.php doesn't work

Requirements: MySQL, PHP5, Webserver Apache/2.0.46 (CentOS)
Apache-CronJob is installed and works (proofed by logs):
 cd /home/httpd/vhosts/

The problem seems to be in the script mail_cron.php (see below).
As programmer says it works on a Linux-server, but it doesn't execute on Apache.
Who can tell-me something about the possible reason?


define("D_INCLUDES", $path . "/includes/");

      require_once "../includes/hall.php";      
      require_once "../includes/template.class.php";
      require_once "../includes/mail.php";

$connection = DB::connect($dsn, true);
if (DB::isError($connection)) {
      trigger_error($connection->getMessage(), E_USER_ERROR);

$query="select mem_sub_id sub_id, memo.ID mem_id, sub_language
            from memo, subscribers
            where (mem_expiry=now()-interval 10 day or mem_expiry=now()-interval 1 month)
                        and mem_sub_id=subscribers.ID order by sub_language";

//echo "\n\n\n $query                        \n\n\n";
$result = $connection->query($query);
      if (DB::isError($result)) {
            trigger_error($result->getMessage(), E_USER_ERROR);
while ($row = $result->fetchRow(DB_FETCHMODE_ASSOC))
      if ($sl!=$_SESSION['lang'])
      MailConfiramtion($sub_id, $mem_id, T_COMMEMORATE);

Thanks for any help!
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.


Why are you running the file from shell?

Would be far easier to make the cron do wget http://server/file.php.
otto_chAuthor Commented:
Hello Gileze33

Sorry, I didn't understand your command.

leads to

What would-you like to show me there?
No I mean you replace the URL.
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

otto_chAuthor Commented:
Sorry, perhaps I'm too stupid to understand.

Please, where should I replace which URL?
I will re-write the script for you.

Is this file on the web, so I can view it?
otto_chAuthor Commented:
No it isn't.

But meantime we solved the problem!
By changing the intro of the script and specifying some paths:
      require_once $_SERVER['DOCUMENT_ROOT'] . '/user/includes/hall.php';
      require_once I_VALIDATE;
      require_once I_MAIL;
      require_once I_TEMPLATE;

$connection = DB::connect($dsn, true);

[The rest of the script is the same like reported in the question posting (above).]

Thank you anyway.
Closed, 500 points refunded.
The Experts Exchange
Community Support Moderator of all Ages

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.