• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

PHP : Problem with the method session_start();

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have mentioned this code 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.

 
Bartender
Posts: 3648
16
Android Mac OS X Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
sudeep naayak
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot.

I tried it in another way and it worked.

Here I am calling session_start() method at the starting of my code.

But I am using session parameters some what later. I declared the same session_start() 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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic