We help IT Professionals succeed at work.
Get Started

php warning in running cron job

greatroni
greatroni asked
on
704 Views
Last Modified: 2008-02-07
Hi experts, I know nothing about php programming so far. I think I will learn that quick if errors keep coming like this :) . THANKS FOR HELP IN ADVANCE.
I am running cron job and getting this error:

PHP Warning:  session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot send session cookie - headers already sent in /home/inter117/public_html/inc/inc.header.php on line 4
<br />
<b>Warning</b>:  session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot send session cookie - headers already sent in <b>/home/inter117/public_html/inc/inc.header.php</b> on line <b>4</b><br />
PHP Warning:  session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot send session cache limiter - headers already sent (output started at /home/inter117/public_html/inc/inc.header.php:4) in /home/inter117/public_html/inc/inc.header.php on line 4
<br />
<b>Warning</b>:  session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot send session cache limiter - headers already sent (output started at /home/inter117/public_html/inc/inc.header.php:4) in <b>/home/inter117/public_html/inc/inc.header.php</b> on line <b>4</b><br />


CRON JOB FILE IS AS FOLLOWS:

<?php
/**
 * Regulars permission for mediafiles access
 */

// Detect DOCUMENT_ROOT var
$_document_root = substr( $argv[0], 0, -14 );

// requiring system headers
require_once( $_document_root.'/configs.php' );
require_once( $_document_root.'/inc/inc.header.php' );


/* --- Profile Timeout Logout --- */

require_once( DIR_APP.'app.profile.php' );

$_query = "SELECT `profile_id` FROM `".TBL_PROFILE_ONLINE."` WHERE `expiration_time`<".time()."";
$_logouted_profiles = MySQL::fetchArray( $_query );

foreach ( $_logouted_profiles as $_profile )
      appProfile::logoutProfile( $_profile['profile_id'] );
      
/* --- Mass mailing --- */

require_once( DIR_APP.'app.mail.php' );

Mail::sendMessages();

/* --- Delete expired Profile register invitations --- */

$_query = "DELETE FROM `".TBL_PROFILE_REGISTER_INVITE_CODE."` WHERE `expiration_date`<'".time()."'";
MySQL::fetchResource( $_query );


/* --- Delete expired email verifications --- */

$_query = "DELETE FROM `".TBL_PROFILE_EMAIL_VERIFY_CODE."` WHERE `expiration_date`<'".time()."'";
MySQL::fetchResource( $_query );

/* --- Delete expired Captcha table --- */

$_query = "DELETE FROM `".TBL_CAPTCHA."` WHERE `expiration_time`<'".time()."'";
MySQL::fetchResource( $_query );

/* --- Delete expired profiles' memberships --- */
require_once( DIR_INC.'class.language.php' );
require_once( DIR_APP.'app.membership.php' );


Comment
Watch Question
Commented:
This problem has been solved!
Unlock 1 Answer and 8 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE