Current location: Hot Scripts Forums » Programming Languages » PHP » "Cannot send cookie" error on production server and not dev server


"Cannot send cookie" error on production server and not dev server

Reply
  #1 (permalink)  
Old 10-23-05, 11:38 PM
harlock harlock is offline
Newbie Coder
 
Join Date: Jul 2005
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
"Cannot send cookie" error on production server and not dev server

I'm developing a PHP5 application using XAMPP on my local PC. After uploading to the production server (a webmaster tier shared hosting account at Pair networks) I get the following error when trying to start a session:
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /usr/www/users/xxxx/functions/data_valid_fns.php:68) in /usr/www/users/xxxx/member.php on line 6

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /usr/www/users/xxxx/functions/data_valid_fns.php:68) in /usr/www/users/xxxx/member.php on line 6
(note I obscured part of the actual paths to xxxx in this post)

On line six of member.php is simply:
PHP Code:

session_start(); 

and data_valid_fns.php contains nothing but functions, no output. There's nothing in my scripts sending headers before session_start(). It all works flawlessly on my XAMPP installation. The only thing on member_php before session_start() is a require that includes some files with functions in them - no output.

On Pair's server I'm using PHP5 as a system CGI, they don't have it installed as a module yet. I am able to install my own compile of PHP5 as a CGI if I need to change something fundamental.

If I do a simple test on Pair's server:

PHP Code:

<?php

session_start
();
echo 
'session start test';
?>
It gives no errors.

If anyone has any ideas, I'm open to them. Should I go through all the scripts and make sure none of them have any spaces or returns before the <?php and after the ?> tags? Could that be an issue?
Reply With Quote
  #2 (permalink)  
Old 10-24-05, 12:11 AM
harlock harlock is offline
Newbie Coder
 
Join Date: Jul 2005
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Seem to have fixed it by making session_start(); appear before the require statements. I guess the production server is more sensitive than my dev server to maybe some random spaces or something...don't know...
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump


All times are GMT -5. The time now is 06:17 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.