LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-10-2007, 01:11 AM   #1
mohtasham1983
Member
 
Registered: Apr 2005
Location: San Jose
Distribution: Fedora 3,4- Ubuntu 6.06 to 8.10, Gentoo and Arch
Posts: 408

Rep: Reputation: 30
having problem in porting php4 code to php5 in sessions


Hi folks,
I had designed a website using PHP last year on my fedora core 4 machine and it was working smoothly. I have not been working on PHP since that time, therefore when I was going to make my website running on my ubuntu edgy machine which runs PHP 5, I am getting the following error:

Code:
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /var/www/html/index.php:14) in
Any idea?
 
Old 04-10-2007, 01:47 AM   #2
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
Well what do you have on line 14 of index.php?
And where do you have the call to session_start() (after line 14 I'd wager)

This is only a warning so the code should still work. (at least I don't think this would be a show stopper)

You probably have this error appearing on the PHP4 code but you're probably not displaying the error, check the error logs.
 
Old 04-10-2007, 02:39 AM   #3
mohtasham1983
Member
 
Registered: Apr 2005
Location: San Jose
Distribution: Fedora 3,4- Ubuntu 6.06 to 8.10, Gentoo and Arch
Posts: 408

Original Poster
Rep: Reputation: 30
actually I placed session_start() at the beginning of each file, so I don't see that warning anymore in my page. Thanks for reply
 
Old 04-10-2007, 02:56 AM   #4
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
Okay, but...there are a couple of cases where that will not work for you:

1) When one file includes another (the session start will already have been started and causes another warning when you try and start it a second time)

2) When you add an object to the session, because the object's class must be declared (include'd) before the session has been started. So class include files must come before session start.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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



Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP5 to PHP4 on FC4? kz26 Fedora 5 10-24-2005 05:09 AM
Php5 >> Php4 Eric45008 Slackware 22 04-25-2005 07:37 PM
Slack 10.0 PHP4 -> PHP5 update pdxluddite Slackware 2 03-29-2005 01:37 AM
upgradeing from php4 to php5 mgarcia001 Debian 0 09-30-2004 07:31 PM
Sessions in PHP4 glj Programming 6 10-23-2001 04:45 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:23 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration