Forums / General Questions / Upgrading to PHP 5.3.x

Upgrading to PHP 5.3.x

Views: 1,975

Results 1 to 17 of 17
6 Jan 2014, 9:36 PM
#1
laurelsstitchery avatar

laurelsstitchery

Zen Follower

Join Date:
Jun 2010
Posts:
145
Plugin Contributions:
0

Upgrading to PHP 5.3.x

I'm using Zencart 1.5.1. Upgraded from 1.5.0 using official procedures.

My webhost is getting ready to stop supporting PHP 5.2 (I'm currently using 5.2.17). They automatically upgraded me to 5.3.27 and I was having an issue with a random error as detailed here: http://www.zen-cart.com/showthread.php?211226-Session-randomly-expiring-on-final-step-of-checkout-process, so I downgraded back to 5.2.17 and have had zero problems since then.

I would like to upgrade back to 5.3.x, since they're not going to be supporting 5.2.x, but I need to know if there's anything special I'm supposed to do on the zencart side before or after I change the PHP version. Thanks! :)

6 Jan 2014, 11:21 PM
#2
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

Re: Upgrading to PHP 5.3.x

Can't really help with your specific question but our host has been running php 5.3.21 for quite a while and we haven't knowingly done anything different.

Host has upgrade to 5.3.27 scheduled for this week since anything less will now fail a PCI scan with the highest level of vulnerability.

Host upgrade to 5.4.x will require patching according to This Doc

Rick
RixStix (dot) com
aka: ChainWeavers (dot) com

7 Jan 2014, 11:44 AM
#3
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Upgrading to PHP 5.3.x

laurelsstitchery:

I need to know if there's anything special I'm supposed to do on the zencart side before or after I change the PHP version. Thanks!

Nothing as far as I'm aware of. Is there anything in the error log files to provide a clue?

Since yours seems to be a 'random' problem, my thoughts are along the lines that it probably has something to do with the SESSION data/handling.

Probably a longshot, but with one of the many hosts I've worked on I came across a problem where the admin sessions were timing out prematurely, and I traced this back to the PHP session.gc_maxlifetime being set to an abnormally low value as a result of a PHP upgrade.
http://stackoverflow.com/questions/3476538/php-sessions-timing-out-too-quickly

Although I state this was a problem with the admin functions, it is quite likely that a similar issue would have been occurring with the non admin functions as well and the admin simply noted the problem before any customers reported it as an issue.

As I say, it's a longshot....

Cheers
RodG

NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.

7 Jan 2014, 7:56 PM
#4
laurelsstitchery avatar

laurelsstitchery

Zen Follower

Join Date:
Jun 2010
Posts:
145
Plugin Contributions:
0

Re: Upgrading to PHP 5.3.x

RodG:

Nothing as far as I'm aware of. Is there anything in the error log files to provide a clue?

Since yours seems to be a 'random' problem, my thoughts are along the lines that it probably has something to do with the SESSION data/handling.

Probably a longshot, but with one of the many hosts I've worked on I came across a problem where the admin sessions were timing out prematurely, and I traced this back to the PHP session.gc_maxlifetime being set to an abnormally low value as a result of a PHP upgrade.
http://stackoverflow.com/questions/3476538/php-sessions-timing-out-too-quickly

Although I state this was a problem with the admin functions, it is quite likely that a similar issue would have been occurring with the non admin functions as well and the admin simply noted the problem before any customers reported it as an issue.

As I say, it's a longshot....

Cheers
RodG

Thanks for your response! :) All the session times were set up correctly after the upgrade, so I'm sure that's not it. The error was happening instantaneously upon hitting the confirm order button, so there wasn't even a second or two before the timeout. Very weird. :)

9 Jan 2014, 5:09 AM
#5
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Upgrading to PHP 5.3.x

laurelsstitchery:

Thanks for your response! :) All the session times were set up correctly after the upgrade,

Not trying to be argumentative, but you know this how?
So, out of curiosity, what is the value of your session.gc_maxlifetime ?

laurelsstitchery:

so I'm sure that's not it.

You've convinced yourself. Now see if you can convince me :)

laurelsstitchery:

The error was happening instantaneously upon hitting the confirm order button, so there wasn't even a second or two before the timeout.

That is exactly what I would expect if this setting is as low as the one that plagued me.

laurelsstitchery:

Very weird. :)

Even more weirder is that you appear to be debunking this possibility without giving it any consideration at all, and for assuming that this would cause some kind of delay rather than happening the instant the button is pressed.

Although I stated it's a longshot, do you have any better ideas? Has anyone else come up with a better idea? Surely it's worth some kind of followup?

Cheers
RodG

NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.

9 Jan 2014, 4:51 PM
#6
laurelsstitchery avatar

laurelsstitchery

Zen Follower

Join Date:
Jun 2010
Posts:
145
Plugin Contributions:
0

Re: Upgrading to PHP 5.3.x

RodG:

Not trying to be argumentative, but you know this how?
So, out of curiosity, what is the value of your session.gc_maxlifetime ?

I printed out the settings in the server info section before I downgraded back to 5.2. The settings are all the same, but magically, it's working correctly now. session.gc_maxlifetime is set to 900 local and 1440 master.

I don't see any reason to be rude. I came here asking for help.

10 Jan 2014, 2:49 AM
#7
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Upgrading to PHP 5.3.x

laurelsstitchery:

I don't see any reason to be rude. I came here asking for help.

The statements previously provided and inquiries asked were not to be taken as rude. None of us are able to see the values that you have in your setup (without being granted access). We are only able to help based on the amount of information provided, preferably with hard facts. (Similar to what was added into the quote of the above message.)

It appeared that the problem had persisted, and being familiar with all things Zen, the question was asked for validation that the suspected cause was not in fact the reason.

Having tagged this thread because I have seen some odd behavior on my own site with regards to some visitors getting unexpectedly timed out, it appeared that the most probable cause was the session.gc_maxlifetime value. Earlier it was stated that effort was taken to verify/set the values, but unfortunately sometimes in troubleshooting an issue changes are made that need to be undone. Whether that specifically is the case here or not, we don't know. At the very least now by confirming the values (and possibly resaving the settings so that they took) it seems your issue has been resolved.

I guess I could go on and on, you have come to the right place to seek help and it is very very rare that there are any personal issues/rudeness. The vast majority of those that offer their free help by openly posting here do so because they are trying to help and can really only do that to the maximum that others try to help them. A good starting point is the general posting guidelines and then to also frame the current situation so that there are no misunderstandings and sufficient info is available to diagnose. Hopefully two things, 1) you don't have any further issues (knock on wood) and 2) that when you do, you'll come back to seek assistance again.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

10 Jan 2014, 2:56 AM
#8
laurelsstitchery avatar

laurelsstitchery

Zen Follower

Join Date:
Jun 2010
Posts:
145
Plugin Contributions:
0

Re: Upgrading to PHP 5.3.x

At the very least now by confirming the values (and possibly resaving the settings so that they took) it seems your issue has been resolved.

The issue was "resolved" by downgrading back to PHP 5.2, which means the issue hasn't really been resolved. I'm now afraid to upgrade back to PHP 5.3.x because of this issue, but my host is going to stop supporting 5.2 soon.

10 Jan 2014, 3:11 AM
#9
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Upgrading to PHP 5.3.x

laurelsstitchery:

The issue was "resolved" by downgrading back to PHP 5.2, which means the issue hasn't really been resolved. I'm now afraid to upgrade back to PHP 5.3.x because of this issue, but my host is going to stop supporting 5.2 soon.

So to confirm understanding. When you said the ession.gc_maxlifetime is set to 900 local and 1440 master, is that the setting under 5.2 as it is currently? It is not clear in the previous post as to which version those settings applied.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

10 Jan 2014, 3:22 AM
#10
laurelsstitchery avatar

laurelsstitchery

Zen Follower

Join Date:
Jun 2010
Posts:
145
Plugin Contributions:
0

Re: Upgrading to PHP 5.3.x

mc12345678:

So to confirm understanding. When you said the ession.gc_maxlifetime is set to 900 local and 1440 master, is that the setting under 5.2 as it is currently? It is not clear in the previous post as to which version those settings applied.

Those were the settings under 5.2 and 5.3. Before I downgraded back to 5.2, I printed out the settings and then compared them once I downgraded. All of them were the same, but everything was working just fine after the downgrade.

My plan for tomorrow is to re-upgrade back to 5.3 because I have a batch of auto ship orders to enter for some customers. I'm hoping the problem will reoccur while I have the Zen Trace plugin activated so that I can run it by the author of that plugin to see if he can find the problem. I will update after that. Hoping to get an answer soon. :)

10 Jan 2014, 6:57 AM
#11
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Upgrading to PHP 5.3.x

laurelsstitchery:

I don't see any reason to be rude. I came here asking for help.

I wasn't trying to be rude. I have far better things to do with my time.

Anyway, thanks for those figures. It now appears that my 'long shot' may not be a long as I 1st thought. The settings you gave are exactly the same as the ones I had on the site giving me the same problem that you are experiencing.

I changed from 900 (15mins) to 3600 (60 mins) and haven't had a problem since.

Before the PHP upgrade, the default value (1440) was being used. The reason I upped it to 3600 is because the client wanted a longer Admin session timeout, so I made the gc value to be equal to the zencart admin session timeout value.

You are welcome to ignore this if you like. I'm probably just fabricating this stuff because I get a kick out of being rude and screwing people like you around. It so much more fun than trying to be helpful. :)

Rgds
RodG

NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.

10 Jan 2014, 1:32 PM
#12
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Upgrading to PHP 5.3.x

RodG:

I wasn't trying to be rude. I have far better things to do with my time.

Anyway, thanks for those figures. It now appears that my 'long shot' may not be a long as I 1st thought. The settings you gave are exactly the same as the ones I had on the site giving me the same problem that you are experiencing.

I changed from 900 (15mins) to 3600 (60 mins) and haven't had a problem since.

Before the PHP upgrade, the default value (1440) was being used. The reason I upped it to 3600 is because the client wanted a longer Admin session timeout, so I made the gc value to be equal to the zencart admin session timeout value.

You are welcome to ignore this if you like. I'm probably just fabricating this stuff because I get a kick out of being rude and screwing people like you around. It so much more fun than trying to be helpful. :)

Rgds
RodG

Seeing as sessions and cookies tend to go somewhat hand-in-hand, what is the suggested time for cookie lifetime? Should it be set to be the same as the session.gc_maxlifetime, longer, shorter, or until the browser is closed?

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

10 Jan 2014, 2:28 PM
#13
laurelsstitchery avatar

laurelsstitchery

Zen Follower

Join Date:
Jun 2010
Posts:
145
Plugin Contributions:
0

Re: Upgrading to PHP 5.3.x

RodG:

I wasn't trying to be rude. I have far better things to do with my time.

Anyway, thanks for those figures. It now appears that my 'long shot' may not be a long as I 1st thought. The settings you gave are exactly the same as the ones I had on the site giving me the same problem that you are experiencing.

I changed from 900 (15mins) to 3600 (60 mins) and haven't had a problem since.

Before the PHP upgrade, the default value (1440) was being used. The reason I upped it to 3600 is because the client wanted a longer Admin session timeout, so I made the gc value to be equal to the zencart admin session timeout value.

You are welcome to ignore this if you like. I'm probably just fabricating this stuff because I get a kick out of being rude and screwing people like you around. It so much more fun than trying to be helpful. :)

Rgds
RodG

Ok, I will try making that change. What no one seems to be able to explain to me though is why these settings worked just fine with PHP 5.2, but not with 5.3. Any idea?

10 Jan 2014, 3:07 PM
#14
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Upgrading to PHP 5.3.x

mc12345678:

Seeing as sessions and cookies tend to go somewhat hand-in-hand, what is the suggested time for cookie lifetime? Should it be set to be the same as the session.gc_maxlifetime, longer, shorter, or until the browser is closed?

These don't go as closely hand in hand as you might think. Sessions are stored on the server. Cookies are stored on the clients machine, as such, the session timings wouldn't have any effect on the cookies.

I also think that this question would be better answered by one of the dev team because I'm really not all that familiar with how ZenCart handles either.

Sorry I can't be more helpful.

Cheers
RodG

NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.

10 Jan 2014, 3:18 PM
#15
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Upgrading to PHP 5.3.x

laurelsstitchery:

Ok, I will try making that change. What no one seems to be able to explain to me though is why these settings worked just fine with PHP 5.2, but not with 5.3. Any idea?

A perfectly good/valid question. Alas, I don't have an answer. I simply found that this took care of my clients problem after I'd spent many hours looking for the cause of their problem, and I was desperate to try anything. In fact I probably did try everything before giving this a go. I was actually taken aback when I found that it actually worked (for me). The only 'logical' thing I can think of is that somehow or other this setting was being ignored on the previous PHP installation.

I still can't say it'll fix the problem for you. All I am saying is that all my previous efforts failed, and this really was a case of clutching at straws and being willing to try anything, even if it didn't make much sense.

If it does take care of your problem too it'll be really good if you could let me/us know (It'll also be good to let us know if you try it and it doesn't work).

Cheers
RodG

NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.

10 Jan 2014, 6:31 PM
#16
laurelsstitchery avatar

laurelsstitchery

Zen Follower

Join Date:
Jun 2010
Posts:
145
Plugin Contributions:
0

Re: Upgrading to PHP 5.3.x

RodG:

A perfectly good/valid question. Alas, I don't have an answer. I simply found that this took care of my clients problem after I'd spent many hours looking for the cause of their problem, and I was desperate to try anything. In fact I probably did try everything before giving this a go. I was actually taken aback when I found that it actually worked (for me). The only 'logical' thing I can think of is that somehow or other this setting was being ignored on the previous PHP installation.

I still can't say it'll fix the problem for you. All I am saying is that all my previous efforts failed, and this really was a case of clutching at straws and being willing to try anything, even if it didn't make much sense.

If it does take care of your problem too it'll be really good if you could let me/us know (It'll also be good to let us know if you try it and it doesn't work).

Cheers
RodG

I do want to genuinely apologize for my comment yesterday. It's no excuse, but it had been a hell of a day and I felt like I was being questioned from all sides. I'm sorry I took it out on you when you were just trying to be helpful.

How did you change the session.gc_maxlifetime on the server? Did you edit the includes/functions/sessions.php file or did you do it via .htaccess or php.ini? I've done a little Googling (always dangerous) and seen it accomplished a couple of different ways. Please let me know when you have a minute. Thanks! :)

11 Jan 2014, 1:28 AM
#17
laurelsstitchery avatar

laurelsstitchery

Zen Follower

Join Date:
Jun 2010
Posts:
145
Plugin Contributions:
0

Re: Upgrading to PHP 5.3.x

I did get the master value of session.gc_maxlifetime changed to a higher number, but the local value is still 900, so that's the one I need help on changing. Thanks! :)