Advertisement:

Author Topic: Cannot use string offset as an array  (Read 431 times)

Offline Raffaele1977

  • Full Member
  • ***
  • Posts: 446
Cannot use string offset as an array
« on: July 04, 2019, 12:14:24 PM »
I updated to PHP 7.2 and when i go inside the forum appears: "Cannot use string offset as an array"
If I go, instead, in a specific topic, it works.

Any help?
Tks!
MacOsX - 10.14.5
SMF 2.0.15
Safari (last) or Chrome (last)

Online @rjen

  • Full Member
  • ***
  • Posts: 505
  • Gender: Male
Re: Cannot use string offset as an array
« Reply #1 on: July 04, 2019, 12:24:44 PM »
SMF 2.0.15 does not support PHP 7.2. Downgrade to version 7.1
Running SMF 2.0 with Tinyportal 1.6.4 at www.fjr-club.nl
Testing SMF 2.1 RC2 with Tinyportal at http://test2.fjr-club.nl/

Offline Raffaele1977

  • Full Member
  • ***
  • Posts: 446
Re: Cannot use string offset as an array
« Reply #2 on: July 04, 2019, 01:06:04 PM »
SMF 2.0.15 does not support PHP 7.2. Downgrade to version 7.1

1a) Tks!
1b) I downgraded to PHP 7.1, but I still receive the same error message;
1c) Should I use CGI or FastCGI?

2) I have other 2 forums and I upgraded to 7.2 and they work correctly (very strange)

What should I do? (I really have no idea, tks)
MacOsX - 10.14.5
SMF 2.0.15
Safari (last) or Chrome (last)

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 58,500
  • Gender: Male
    • Kindred-999 on GitHub
Re: Cannot use string offset as an array
« Reply #3 on: July 04, 2019, 01:08:03 PM »
1- SMF 2.0.x does not support php 7.2, as already stated.

2- If the site is still throwing the same error, then you probably didn't actually apply the step-down to 7.1

3- if the other sites work without errors, then they are not actually running 7.2
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline Raffaele1977

  • Full Member
  • ***
  • Posts: 446
Re: Cannot use string offset as an array
« Reply #4 on: July 04, 2019, 01:26:27 PM »
1- SMF 2.0.x does not support php 7.2, as already stated.

2- If the site is still throwing the same error, then you probably didn't actually apply the step-down to 7.1

3- if the other sites work without errors, then they are not actually running 7.2

1 - Yes, ok, received :)

2-3 - It means that the downgrade has not done correctly?
But in the control panel it appears done, it states 7.1
MacOsX - 10.14.5
SMF 2.0.15
Safari (last) or Chrome (last)

Offline Raffaele1977

  • Full Member
  • ***
  • Posts: 446
Re: Cannot use string offset as an array
« Reply #5 on: July 04, 2019, 02:50:14 PM »
Update

In the guide of my provider, I noticed that I can change the PHP version in two ways:
1) by admin panel of my domains;
2) by .htaccess file

What I have done:
a) I downgraded (by admin panel) my forums B and C to 7.1 FastCGI, even if the already worked with 7.2 FastCGI--> everything ok;

b1) I modified the .htaccess file for forum A to PHP 5.6 and now it works--> but with PHP 7.1 it doesn't work--> I cannot understand the reason :(
b2) Then I tried to use PHP 7.0 with .htaccessfile and it works--> so the problem is only with versions 7.1 and 7.2

Can someone help me to understand the reason?
Tks for your help.

Now the website works (with 7.0), but I'd like to understand where's the problem.
« Last Edit: July 04, 2019, 03:03:49 PM by Raffaele1977 »
MacOsX - 10.14.5
SMF 2.0.15
Safari (last) or Chrome (last)

Online @rjen

  • Full Member
  • ***
  • Posts: 505
  • Gender: Male
Re: Cannot use string offset as an array
« Reply #6 on: July 04, 2019, 03:22:10 PM »
I suspect it may be a mod that has a problem with php 7.1.  What mods do you have installed?
Running SMF 2.0 with Tinyportal 1.6.4 at www.fjr-club.nl
Testing SMF 2.1 RC2 with Tinyportal at http://test2.fjr-club.nl/

Offline Raffaele1977

  • Full Member
  • ***
  • Posts: 446
Re: Cannot use string offset as an array
« Reply #7 on: July 04, 2019, 03:26:55 PM »
1.   SimplePortal   2.3.3     
2.   Google Analytics Code   1.4
3.   SMF 2.0.8 Update   1.0     
4.   Subject length on Board Index   1.3
5.   Simple Audio Video Embedder   4.5.3a
6.   Topic Solved   1.1.1     
7.   Bookmarks   2.3     
8.   Started By Column   1.4
9.   Custom Board Sort   1.0.2
10.   Avatars on Board/MessageIndex   1.7 
11.   Guest Attachment Preview   1.0.1   
12.   Users Online Today   2.0 RC4
13.   Simple Spoiler   1.0.2     
14.   SMF 2.0.12 Update   1.0     
15.   Info Center Permissions   1.0
16.   Sitemap   2.2.0     
17.   Newsletter Pro   2.0.7   
18.   SMF 2.0.14 Update   1.0
19.   SMF Activity Stream PRO Mods Integration   1.0
20.   AGL_management   1.0     
21.   SMF Multi Quote   1.1.3     
22.   Menu_Icons   1.0
23.   [BBCode] Blink   1.0
24.   Remove Post Modified Time   1.2 
25.   Footnotes   1.08     
26.   Menu Order   0.2.6
27.   Float BBCODE   1.0.2
28.   Who Downloaded Attachment   1.0.5
29.   SMF 2.0.13 Update   1.0     
30.   Advanced Topic Prefix Mod   3.0     
31.   Countdown BBCode   2.0.1     
32.   Hide Signatures from Guests   2.0
33.   Inuitive Age   1.0     
34.   Contact Page   4.0     
35.   SMFPacks Likes Pro Mod   1.3.6
36.   SMF Wiki   {version}   
37.   Stars And Badges   2.2
38.   SMF 2.0.15 Update   1.0
39.   Login Form Fix   1.0     
40.   Simple Audio Video Embedder   4.3
41.   Fix Firefox 8.0 download problems   1.0.0
42.   SMF 1.1.19 / 2.0.6 Update   1.0     
43.   SMF 2.0.1 Update   1.0 
44.   SMF 2.0.2 Update   1.0 
45.   SMF 2.0.3 Update   1.0 
46.   SMF 2.0.4 Update   1.0 
47.   SMF 2.0.5 Update   1.0 
48.   SMF 2.0.7 Update   1.0 
49.   Improved Displayed Times WOT Mod   1.0
50.   SMF 1.1.20 / 2.0.9 Update   1.0     
51.   SMF 1.1.21 / 2.0.10 Update   1.0
52.   Topic Viewers   1.0     
53.   Order Custom Profile Fields   1.1.1
54.   SMF 2.0.11 Update   1.0     
55.   Avatars on Board/MessageIndex   1.6
56.   Simple Audio Video Embedder
MacOsX - 10.14.5
SMF 2.0.15
Safari (last) or Chrome (last)

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 58,500
  • Gender: Male
    • Kindred-999 on GitHub
Re: Cannot use string offset as an array
« Reply #8 on: July 04, 2019, 03:40:25 PM »
What is the EXACT error you get when you use 7.1?
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Online @rjen

  • Full Member
  • ***
  • Posts: 505
  • Gender: Male
Re: Cannot use string offset as an array
« Reply #9 on: July 04, 2019, 03:41:15 PM »
Do you get any errors in the log? If so which?

Difficult to pInpoint the culprit without more details...
Running SMF 2.0 with Tinyportal 1.6.4 at www.fjr-club.nl
Testing SMF 2.1 RC2 with Tinyportal at http://test2.fjr-club.nl/

Offline Raffaele1977

  • Full Member
  • ***
  • Posts: 446
Re: Cannot use string offset as an array
« Reply #10 on: July 04, 2019, 03:55:11 PM »
What is the EXACT error you get when you use 7.1?

In the index of the forum I see ONLY this message: Cannot use string offset as an array
And I don't see any board.

Do you get any errors in the log? If so which?

Difficult to pInpoint the culprit without more details...

In the log I see these 4 errors when I try to use PHP 7.1.
The page the errors come from is: https://mydomain.com/index.php?action=forum

1) 2: Invalid argument supplied for foreach()
File: /Themes/default/index.template.php
Line:    foreach ($context['menu_buttons'] as $act => $button)

2) 8: Undefined index: menu_buttons
File: /Themes/default/index.template.php
Line:    foreach ($context['menu_buttons'] as $act => $button)

3) 8: Undefined index: show_pm_popup
File: /Themes/default/index.template.php
Line:       var smf_charset = "', $context['character_set'], '";', $context['show_pm_popup'] ? '

4) 2: Illegal string offset 'value'
File: /Sources/abm_code.php
This refers to Avatars on Board/MessageIndex MOD
Line:    foreach($abm_id as $abm['value'][]) {}
MacOsX - 10.14.5
SMF 2.0.15
Safari (last) or Chrome (last)

Online @rjen

  • Full Member
  • ***
  • Posts: 505
  • Gender: Male
Re: Cannot use string offset as an array
« Reply #11 on: July 04, 2019, 04:06:16 PM »
There you go: avatars on board mod does not play nice with php 7.1
Running SMF 2.0 with Tinyportal 1.6.4 at www.fjr-club.nl
Testing SMF 2.1 RC2 with Tinyportal at http://test2.fjr-club.nl/

Offline vbgamer45

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 21,555
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Cannot use string offset as an array
« Reply #12 on: July 04, 2019, 04:07:16 PM »
Yeah, I think I had to modify that mod to get working on my forum sites.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Offline Raffaele1977

  • Full Member
  • ***
  • Posts: 446
Re: Cannot use string offset as an array
« Reply #13 on: July 04, 2019, 04:08:35 PM »
There you go: avatars on board mod does not play nice with php 7.1

Tks!

Yeah, I think I had to modify that mod to get working on my forum sites.

Do you remember what you did?
MacOsX - 10.14.5
SMF 2.0.15
Safari (last) or Chrome (last)

Offline vbgamer45

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 21,555
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Cannot use string offset as an array
« Reply #14 on: July 04, 2019, 04:09:26 PM »
Not off hand was a while ago.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Offline Raffaele1977

  • Full Member
  • ***
  • Posts: 446
Re: Cannot use string offset as an array
« Reply #15 on: July 04, 2019, 04:28:08 PM »
Ok I solved it: I updated the mod from 1.7 to 2.0.

Version 2.0 - Dec 28, 2017
- Fixed: Illegal string offset 'value' (due > PHP 7.1)
- Added: Proxy for external avatar urls

Tks to all for the fast help 💙
MacOsX - 10.14.5
SMF 2.0.15
Safari (last) or Chrome (last)