Forums / General Questions / Product downloads stopped working after host changed PHP version, had been fine

Product downloads stopped working after host changed PHP version, had been fine

Views: 1,080

Results 1 to 6 of 6
5 Jul 2012, 9:38 PM
#1
schase avatar

schase

New Zenner

Join Date:
Jul 2012
Posts:
3
Plugin Contributions:
0

Product downloads stopped working after host changed PHP version, had been fine

Zencart version 1.5.0, hosting service Hosting Matters. I have a store with ebooks that customers download, and it had been working very well. Then my customers started getting an error after they had ordered and paid for their books, preventing the download (Forbidden --You don't have permission to access /zencart/pub/.kwtytuyvvcxztfxs-1340634066/RavensChildrenARC.mobi on this server. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.)

I had done nothing to change my Zencart store. My hosting service says the only change they did to the server hosting my store was change the php version from 5.2 to 5.3, but I think if that had caused problems the forum would be in flames :blink: The only other issue I noticed was an error message when I log in to the zencart admin, concerning timestamps that I could work around (supposedly zencart not recognizing the valid timezone set in the system php.ini) would that somehow cause download errors? My site error log shows nothing. I looked in the /zencart/cache log files, which only show the timestamp error:

date() [<a href='function.date'>function.date</a>]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/chaseadv/public_html/zencart/includes/counter.php on line 21
[05-Jul-2012 20:26:20 UTC] PHP Warning:  mktime() [<a href='function.mktime'>function.mktime</a>]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/chaseadv/public_html/zencart/includes/counter.php on line 53
[05-Jul-2012 20:26:20 UTC] PHP Warning:  strftime() [<a href='function.strftime'>function.strftime</a>]: It is not safe to rely on the system's timezone settings. You are 

Thanks in advance,
Sabrina

5 Jul 2012, 9:45 PM
#2
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,845
Plugin Contributions:
17

Re: Product downloads stopped working after host changed PHP version, had been fine

IF the host is the only one who has made ANY changes, then the host is where I would look for a fix. It may be that their changes also included a different CHMOD for the folders. The forbidden tends to tell me that's the solution but the 404 does cloud the issue.

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

5 Jul 2012, 10:43 PM
#3
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Product downloads stopped working after host changed PHP version, had been fine

The PHP error messages you quoted are evidence that the hosting company's change to the new PHP version left out an important step: defining the date.timezone setting for the server.

You should report those messages to your hosting company so they can fix the server's configuration.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

5 Jul 2012, 10:45 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Product downloads stopped working after host changed PHP version, had been fine

Further, if you are trying to serve downloads of files ending in ".mobi", then you should update your /pub/.htaccess file and add mobi to the list of valid extensions, else 403-forbidden responses will naturally occur.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

6 Jul 2012, 12:10 AM
#5
schase avatar

schase

New Zenner

Join Date:
Jul 2012
Posts:
3
Plugin Contributions:
0

Re: Product downloads stopped working after host changed PHP version, had been fine

Yep, I modified the .htaccess in the download folder some time ago, before this issue showed up. The hosting service is aware of the problem but hasn't figured out the cause, so I thought asking the forum was a good idea. Just in case someone had similar problems. Thanks!
added: the problem shows up with epub files too, which are allowed by default in the .htaccess files. Pretty sure they aren't the source of the problem.

6 Jul 2012, 7:07 PM
#6
schase avatar

schase

New Zenner

Join Date:
Jul 2012
Posts:
3
Plugin Contributions:
0

Re: Product downloads stopped working after host changed PHP version, had been fine

Further update:
My hosting service switched me to a server that did not have the PHP update and everything works again. They told me that they did have the date.timezone defined in the systemwide php.ini but that for some reason Zencart wasn't picking it up. To me that sounds like there is some override setting or file that Zencart is using in preference to the systemwide setting. (but only in php 5.3??)