File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Node.js in Action
this week in the
PHP : Problem with the method session_start();
Joined: Sep 04, 2009
Sep 08, 2009 03:57:19
I have mentioned this code
<?php session_start(); ?>
at 1st line of my code.
It is working fine in localhost. But when I uploaded to my server then it shows me the following warning
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at ......
After viewing this warning rest of the page working fine.
Can anybody help me ...how to remove this warning and tell me the reason for what this is coming only at server not in localhost.
Joined: Sep 13, 2007
Sep 09, 2009 06:48:45
Welcome to the Ranch Sudeep.
The reason could be your local Apache server and the server's Apache server configuration is not the same. One way to check is to echo the session_cache_limiter or check the phpinfo().
Base on the returned value, you may want to change it BEFORE calling session_start();
Another way is something to do with output buffering, which must be called (ob_start()) before session_start();
Hope this helps.
Joined: Sep 04, 2009
Sep 09, 2009 07:47:11
Thanks a lot.
I tried it in another way and it worked.
Here I am calling
method at the starting of my code.
But I am using session parameters some what later. I declared the same
method again here also.
Now it works fine
I think due to older version of php in the server it requires to initialize the session where exactly it needs.
By the way
Thanks for the valuable information and your time
I agree. Here's the link:
subject: PHP : Problem with the method session_start();
using the value of a session variable
difficulty in login in one attempt
php , html ...
html5 and php
Need to implement Session time out in PHP code
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014