What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » PHP: A question for the pros

PHP: A question for the pros
Author: Message:
lhunath
Full Member
***

Avatar
.{ Lord Daisy }.

Posts: 343
39 / Male / –
Joined: May 2004
O.P. PHP: A question for the pros
Let me start of by appologising for putting this question on a forum about Messenger Plus!. However; I know there's plenty of smart people out here that have extensive experience with PHP which is the reason why I decided to seek assistance here.

I've an issue with my webserver Apache which has been set up to use the PHP module (5.0).
I've root access to all of the server, so I can easily change everything. I've a hunch this is where things started going wrong in the first place as well. Let me detail the situation.

The problem is to do with Sessions.
My PHP scripts can successfully start sessions and I get a SESSION ID assigned for each. Session data is stored to the session.save_path I've set in my php.ini file.
When session.save_handler is set to "files"; session files are made in the folder (it's /tmp/php). They contain the session data. All well so far.
This is where it starts going wrong. Session variables are only just added to the session data file. They are never *updated*. For example; my initial session value for the variable "lang" is "nl". When I click the button to change the language to "fr"; on the next page the value of the variable changes to "fr", since it was passed using POST. My script runs _SESSION["lang"] = "fr"; on that page everything looks french; however, when we click the next link -- everything reverts to "nl" since the session data was not updated and is still "nl" in the session file. The original value.

I pray any of you have a sollution for this issue. I need to get the website of a company online *this* week. If you can't assist me -- please do redirect me elsewhere.

And no -- the issue has nothing to do with my PHP script. The code works perfectly on another server. The issue must be something to do with my apache/php/linux configuration.

For your information; the /tmp/php folder has as user "root"; as group "apache" (tried "nobody", too). As permissions the mask 770 (777 doesn't work either). I doubt permissions are the issue as the files are indeed written to disk - just not updated.

Thank you so much for you interest and moment of thought,
~lhunath

This post was edited on 10-13-2005 at 08:22 PM by lhunath.
{ -[Image: lhunath.gif]- }
10-13-2005 08:18 PM
Profile E-Mail PM Web Find Quote Report
brian
Senior Member
****

Avatar

Posts: 819
Reputation: 43
– / Male / –
Joined: Sep 2004
RE: PHP: A question for the pros
Odd..

Tried comparing Apache/PHP configs between the two servers?

Anyhow, is the other server running PHP4 or PHP5? Some features or w/e could be different.

Anyways, care to tell me if your register_globals is enabled? aswell as posting the configs?

For more help, refer this page too, http://www.php.net/session
10-13-2005 09:54 PM
Profile PM Find Quote Report
J-Thread
Full Member
***

Avatar

Posts: 467
Reputation: 8
– / Male / –
Joined: Jul 2004
RE: PHP: A question for the pros
Can you please post the header of your scripts here? I mean session_start() and all the code where you set and load your session vars...
10-14-2005 09:24 AM
Profile E-Mail PM Find Quote Report
brian
Senior Member
****

Avatar

Posts: 819
Reputation: 43
– / Male / –
Joined: Sep 2004
RE: PHP: A question for the pros
He read and said it completely functioned on another server, J-Thread, it's probably not his code.
10-14-2005 10:33 AM
Profile PM Find Quote Report
J-Thread
Full Member
***

Avatar

Posts: 467
Reputation: 8
– / Male / –
Joined: Jul 2004
RE: PHP: A question for the pros
I know, but there are 2 ways to solve this problem.

1: change his config and make the script work
2: change the script so it works on both servers

Besides that, it may be usefull information to exactly know how he manage his sessions...
10-14-2005 02:03 PM
Profile E-Mail PM Find Quote Report
lhunath
Full Member
***

Avatar
.{ Lord Daisy }.

Posts: 343
39 / Male / –
Joined: May 2004
O.P. RE: PHP: A question for the pros
The code is mine; but I have no access to the Apache/PHP configs on the other server.

Things went as they do far too often sadly -- I mucked about with a basic script -- trying to reproduce the problem. Sessions seemed to work flawlessly there. So I took it my session handling functions were flawed. I fixed those up (none of the fixes should have caused anything near what I discribed in the first post), enaled register_globals (for which I'd written a workaround as well -- my scripts sadly rely on register globals but I had written some code to automatically register all REQUEST variables as globally available in case the server didn't support register_globals. Point is - it now works and I changed so much inbetween testing I haven't a clue which of the changes fixed the damn thing.

Anyhow, I'm flattered with the interest and would like to gracefully thank you all for your replies. May whatever God you believe in grant you whatever it is you wish for most -- except if it's total world domination or something of that kind.

Thanks again :)
and au revoir,
~ lhunath
{ -[Image: lhunath.gif]- }
10-15-2005 06:58 PM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On