Ramon Smits

Tell me your secrets and i'll tell you mine

Recent Posts

Tags

Community

Email Notifications

Patterns & Practices / Guidelines

EntLib

Nant

Blogs that I monitor

Archives

Weird php session behaviour

I am creating a nice webapplication for my volleybal club and it is progressing nice. Yesterday I deployed a new version on the server and experienced weird php session behaviour. Although I am primarily developing in .net I really love experimenting with other environments I really had to post this here.

The application worked perfect on my local dev box. A nice vmware windows 2003 install with xampp installed. The isp server is running linux. It seemed that there was a difference in some php settings. The setting that was causing havoc was "register_globals". Well knowing which settings was incorrect didn't bring the solution in sight. How was I able to alter it? Well it seemed that this was possible by altering the ".htaccess" file in the root of the application. I added the following line:
	php_flag register_globals 0
And now it is working perfect! Hooray!

Comments

Dennis van der Stelt said:

What does this have to do with Blogging About .NET? :)

# October 28, 2006 6:06 AM

Ramon Smits said:

Pretty much nothing... but if I would have posted a photo of a nice woman you would not complain ;-)

# October 28, 2006 9:16 AM

Dennis van der Stelt said:

LOL! :)

# October 28, 2006 12:22 PM

Lennard said:

Now i wonder what is so weird about different behaviour if settings are different. It would be the same if i changed a machine.conf settings on my dev and prod machine. And then questing why .NET acts different or weird...
# October 30, 2006 4:18 AM

Ramon Smits said:

@Lennard: Well it doesn't matter that settings are different. The difference in the machine.config settings between XP and 2003 are huge.

It is important to learn the impact of a certain settings. I posted this because I am not a very experienced php programmer (although I've already seen lots of crap php code as most code of the web is produced by learning programmers).

The thing with this settings is that on most ISP machines it is turned ON for backwards compatibility although the default is OFF for a standard installation.

Besides that I had problems with the php session so I thought it would be a settings in that configuration section but this settings has nothing to do with the setting but with global behaviour.

If you google around you will not find much helpfull information. Not on the web and not in the php documentation thus the reason to post this.

# October 30, 2006 5:10 AM

John Hansen said:

Thank you so much! This saved me a MAJOR headache here at work.

# February 2, 2007 10:30 AM
Leave a Comment

(required) 

(required) 

(optional)

(required) 


Please add 5 and 8 and type the answer here: