KristiaanD
asked on
HTTP_COOKIE does not appear in phpinfo()
Hi.
I am trying to set up a MacBook Pro running OS X Leopard 10.5.6 as a webserver to do some php development on during the coming holidays.
The server software is apache 2.2.9, with php 5.2.5
No matter how I try, i can't get sessions to work.
Inspecting the phpinfo page showed the entry for HTTP_COOKIE to be missing, which i assume is why sessions won't work.
Any ideas on how to remedy this ?
I am trying to set up a MacBook Pro running OS X Leopard 10.5.6 as a webserver to do some php development on during the coming holidays.
The server software is apache 2.2.9, with php 5.2.5
No matter how I try, i can't get sessions to work.
Inspecting the phpinfo page showed the entry for HTTP_COOKIE to be missing, which i assume is why sessions won't work.
Any ideas on how to remedy this ?
It is not showing up because you are not passing it any cookie info for that domain on that request.
Try the code below. You will have to hit the page more than once. The first time it sets the cookie. The second time the browser will pass the cookie back, then you will see cookie info.
Try the code below. You will have to hit the page more than once. The first time it sets the cookie. The second time the browser will pass the cookie back, then you will see cookie info.
<?php
session_start();
phpinfo();
ASKER
Sorry for the delay in replying to the comments - I have been abroad for a few weeks.
With the above code snippets things still didn't work.
I finally resolved to reinstalling the system on the MacBook, thereby falling back to the original PHP installation as provided by Apple. After that things worked as they should.
However: since the apple installation doesn't come with all the extensions that I'd like to use for the website (like mcrypt and gd), this is not a very satisfying solution.
I've read articles on the net on compiling PHP yourself, but this does seem a daunting task.
Any suggestions ?
With the above code snippets things still didn't work.
I finally resolved to reinstalling the system on the MacBook, thereby falling back to the original PHP installation as provided by Apple. After that things worked as they should.
However: since the apple installation doesn't come with all the extensions that I'd like to use for the website (like mcrypt and gd), this is not a very satisfying solution.
I've read articles on the net on compiling PHP yourself, but this does seem a daunting task.
Any suggestions ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Are you wanting to use cookies or sessions?
And have you tried just some simple tests like create a php script with the following just to see which is working:
Open in new window