Zen Cart Logo
Forums / General Questions / PHP Warning: Illegal string offset 'versionMajor'

PHP Warning: Illegal string offset 'versionMajor'

Views: 3,905

Results 1 to 9 of 9
10 May 2018, 3:27 PM
#1
gwynwyffar avatar

gwynwyffar

New Zenner

Join Date:
Dec 2006
Location:
Hudson Valley, New York USA
Posts:
93
Plugin Contributions:
0

PHP Warning: Illegal string offset 'versionMajor'

I'm running version 1.55f and this just started appearing in debug logs this morning along with some strange code next to a notice for a new version release in my admin. I've double checked the files on the server and don't see that any of them have been touched. I'm assuming the error is due to what I'm getting back from the Zen Cart version server. Also when I click the "Download Now" button it just redirects to a non-existent page in my own catalog generating a 404 error.

See attached image and debug log.

[Attachment no longer available]

10 May 2018, 3:32 PM
#2
brent avatar

brent

Totally Zenned

Join Date:
Mar 2005
Location:
United Kingdom
Posts:
606
Plugin Contributions:
0

Re: PHP Warning: Illegal string offset 'versionMajor'

I've had similar issues for the past few hours. I think it is a problem at the Zen Cart end and not ours.

[10-May-2018 15:28:26 UTC] PHP Notice: CURL error checking plugin versions: Failed to connect to ping.zen-cart.com port 443: Connection refused[7] in .../includes/functions/plugin_support.php on line 41

10 May 2018, 3:34 PM
#3
gwynwyffar avatar

gwynwyffar

New Zenner

Join Date:
Dec 2006
Location:
Hudson Valley, New York USA
Posts:
93
Plugin Contributions:
0

Re: PHP Warning: Illegal string offset 'versionMajor'

Yes, I just noticed a debug from another plugin that was trying to connect to the Zen Cart version server. I just wanted ZC staff to be aware, if they weren't already.

10 May 2018, 3:52 PM
#4
brent avatar

brent

Totally Zenned

Join Date:
Mar 2005
Location:
United Kingdom
Posts:
606
Plugin Contributions:
0

Re: PHP Warning: Illegal string offset 'versionMajor'

I'm glad you did. When it started I checked the forums and was expecting to see loads of reports. There were none and as I had just installed a plugin I needed to rule out I hadn't broken things my end.

Was just about to start looking in to that possibility when I checked again and saw your post.

10 May 2018, 4:46 PM
#5
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: PHP Warning: Illegal string offset 'versionMajor'

There have been intermittent reports of this type of result for a while. A potential solution to this has been posted here: https://www.zen-cart.com/showthread.php?223852-New-Version-Available-code-doesn-t-handle-error-return-from-getProjectVersion&p=1344606#post1344606

The issue being that when an error occurs in the version check that a string is returned. The software generally expects an array to be returned and therefore doesn't respond in a controlled, expected manner. So as also identified elsewhere (https://www.zen-cart.com/showthread.php?223473-When-offline-Illegal-string-offset-versionMajor), the issue could be caused by being on a local server that is offline.

10 May 2018, 5:00 PM
#6
brent avatar

brent

Totally Zenned

Join Date:
Mar 2005
Location:
United Kingdom
Posts:
606
Plugin Contributions:
0

Re: PHP Warning: Illegal string offset 'versionMajor'

Thanks I did see that. My main concern is performance though. My Admin seems to take a hit while waiting for the response.

I notice another thread has just been started so hopefully there is a problem with the versioning server that needs sorting.

10 May 2018, 5:03 PM
#7
drbyte avatar

drbyte

Sensei

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

Re: PHP Warning: Illegal string offset 'versionMajor'

Yes, There were some problems with the version-server over the past couple hours. Things appear to be working properly again now.

10 May 2018, 5:06 PM
#8
gwynwyffar avatar

gwynwyffar

New Zenner

Join Date:
Dec 2006
Location:
Hudson Valley, New York USA
Posts:
93
Plugin Contributions:
0

Re: PHP Warning: Illegal string offset 'versionMajor'

In my case this was our live server that is definitely online. Not a local server. I made the changes to VersionServer.php and header.php as suggested in the thread you linked mc12345678 and I'm no longer getting the PHP warnings, nor am I getting any CURL errors listed (I guess since the server is back online :) ). Thanks for the help.

10 May 2018, 5:09 PM
#9
brent avatar

brent

Totally Zenned

Join Date:
Mar 2005
Location:
United Kingdom
Posts:
606
Plugin Contributions:
0

Re: PHP Warning: Illegal string offset 'versionMajor'

Yes fine for me too now. I made no changes though as I don't have issue with the strange error. Leaving stock code gives me one less thing to compare on future upgrades.