This is a discussion on PHP Sessions within the alt.comp.lang.php forums, part of the PHP Programming Forums category; Hi I'm having trouble getting sessions to work on my server. It's working on my univeristy account so ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi
I'm having trouble getting sessions to work on my server. It's working on my univeristy account so I assume that there is nothing wrong with the code. This is what my phpinfo(); is on my server http://victor.is-a-geek.com/about/ This is what the phpinfo(); is on the university server http://pages.cpsc.ucalgary.ca/~louiev/index.php Any help would be good. I'm running PHP 4.3.4, Apache 1.3 and Redhat 9.0 on my server. There some simple code on the top for a simple counter...pushing refresh updates the number on the unversity server but not mine. Thanks Victor |
|
|||
|
From: "victor"
> Hi > > I'm having trouble getting sessions to work on my server. > > It's working on my univeristy account so I assume that there is nothing > wrong with the code. > > This is what my phpinfo(); is on my server > http://victor.is-a-geek.com/about/ > > This is what the phpinfo(); is on the university server > http://pages.cpsc.ucalgary.ca/~louiev/index.php > > Any help would be good. I'm running PHP 4.3.4, Apache 1.3 and Redhat > 9.0 on my server. Dear victor, what kind of error get you (use: error_reporting(E_ALL))? Maybe not the session handling itself is the problem. I have noticed that you have on your server register_globals Off. On your uni server, register_globals is On! Maybe this affect your script. Keep in mind that register_globals off is recommend, and you should not turn it on! Michael |
|
|||
|
Michael Meckelein wrote:
> From: "victor" > >>Hi >> >>I'm having trouble getting sessions to work on my server. >> >>It's working on my univeristy account so I assume that there is > > nothing > >>wrong with the code. >> >>This is what my phpinfo(); is on my server >> http://victor.is-a-geek.com/about/ >> >>This is what the phpinfo(); is on the university server >> http://pages.cpsc.ucalgary.ca/~louiev/index.php >> >>Any help would be good. I'm running PHP 4.3.4, Apache 1.3 and > > Redhat > >>9.0 on my server. > > > Dear victor, > > what kind of error get you (use: error_reporting(E_ALL))? > > Maybe not the session handling itself is the problem. I have noticed > that > you have on your server register_globals Off. On your uni server, > register_globals is On! Maybe this affect your script. > > Keep in mind that register_globals off is recommend, and you should > not turn > it on! > > Michael > Hi It's not really an error...its just that sessions don't seem to be working. I figure it wasn't the code. This is the counter code up on the top: <?php session_start(); session_register('hits'); ++$hits; ?> <html> <head><title>this is stupid</title></head> <body> <p> This page has been viewed <?= $hits; ?> times. </p> </body> </html> Victor |
|
|||
|
victor wrote:
> Hi > > I'm having trouble getting sessions to work on my server. > > It's working on my univeristy account so I assume that there is nothing > wrong with the code. > > This is what my phpinfo(); is on my server > http://victor.is-a-geek.com/about/ > > This is what the phpinfo(); is on the university server > http://pages.cpsc.ucalgary.ca/~louiev/index.php > > Any help would be good. I'm running PHP 4.3.4, Apache 1.3 and Redhat > 9.0 on my server. > > There some simple code on the top for a simple counter...pushing refresh > updates the number on the unversity server but not mine. > > Thanks > Victor > Hi again, I've installed PHP and Apache on another computer in my house and I get this error now. It's installed on a Win XP machine. Any idea on how to fix this one? Any help is good... Thanks Victor |
|
|||
|
victor wrote:
> victor wrote: > >> Hi >> >> I'm having trouble getting sessions to work on my server. >> >> It's working on my univeristy account so I assume that there is >> nothing wrong with the code. >> >> This is what my phpinfo(); is on my server >> http://victor.is-a-geek.com/about/ >> >> This is what the phpinfo(); is on the university server >> http://pages.cpsc.ucalgary.ca/~louiev/index.php >> >> Any help would be good. I'm running PHP 4.3.4, Apache 1.3 and Redhat >> 9.0 on my server. >> >> There some simple code on the top for a simple counter...pushing >> refresh updates the number on the unversity server but not mine. >> >> Thanks >> Victor >> > Hi again, > > I've installed PHP and Apache on another computer in my house and I get > this error now. It's installed on a Win XP machine. > > Any idea on how to fix this one? > > Any help is good... > > Thanks > Victor > > Sorry the error is this Warning: session_start(): open(/tmp\sess_98ead586446f05cd8679b98d2671af2c, O_RDWR) failed: No such file or directory (2) in E:\index.php on line 2 Warning: session_start(): Cannot send session cookie - headers already sent by (output started at E:\index.php:2) in E:\index.php on line 2 Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at E:\index.php:2) in E:\index.php on line 2 Thanks Victor |
|
|||
|
On 2004-01-27, victor <vlouie21@hotmail.com> wrote:
> Warning: session_start(): > open(/tmp\sess_98ead586446f05cd8679b98d2671af2c, O_RDWR) failed: No such > file or directory (2) in E:\index.php on line 2 Edit your php.ini file, and make session.save_path=c:/windows/tmp or whatever folder you like. Afterwards you lookup why it is a good idea to have a different session.save_path for each user (will be mentionned in every document on php and security i guess) -- http://home.mysth.be/~timvw |
|
|||
|
"victor" wrote
> Warning: session_start(): Cannot send session cookie - headers already > sent by (output started at E:\index.php:2) in E:\index.php on line 2 Be sure that you not send any other header (e.g. html tags ) befor you have handled your sessions. Michael |
|
|||
|
"Michael Meckelein" <michael@go-on-line.de> wrote in message news:bv5duo$odifd$1@ID-208606.news.uni-berlin.de... > "victor" wrote > > Warning: session_start(): Cannot send session cookie - headers already > > sent by (output started at E:\index.php:2) in E:\index.php on line 2 > > Be sure that you not send any other header (e.g. html tags ) befor you have > handled your sessions. > > Michael > You can also use buffering, and your HTTP Headers will get put at the top for you when it does the output. www.php.net/ob_start Chris |