Advertisement:

Author Topic: How to resolve deprecated error?  (Read 359 times)

Offline La_Lafayette

  • Newbie
  • *
  • Posts: 2
How to resolve deprecated error?
« on: December 06, 2018, 01:05:57 AM »
hxxp:i.gyazo.com/68feeb1db8724c8ba89ab7b4504a1cd0.png [nonactive]


I'm at a loss with this error

using SMF 2.0.15

Offline Aleksi "Lex" Kilpinen

  • A Peculiar Finn
  • Lead Support Specialist
  • SMF Super Hero
  • *
  • Posts: 17,586
  • Gender: Male
  • Don't worry, I'm n00b friendly
    • Aleksi.Kilpinen on Facebook
    • aleksi-kilpinen on LinkedIn
Re: How to resolve deprecated error?
« Reply #1 on: December 06, 2018, 01:15:26 AM »
SMF 2.0.15 only supports up to PHP 7.1 as PHP 7.2 is deprecating create_function() and this is used by the BBCode parser.

See discussion from this post on https://www.simplemachines.org/community/index.php?topic=558072.msg3955359#msg3955359
A Finnish Support Specialist
 Happily running multiple SMF 2.0 installations.

How you can help SMF

"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum.
 Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

Offline La_Lafayette

  • Newbie
  • *
  • Posts: 2
Re: How to resolve deprecated error?
« Reply #2 on: December 06, 2018, 01:22:20 AM »
// Disable PHP 7.2 "Function create_function() is deprecated"  errors from filling the forum error logs
   if (defined('E_DEPRECATED') && $error_level == E_DEPRECATED && phpversion() == '7.2.0' && strpos($error_string, 'Function create_function() is deprecated') !== false)
      return;

this is the function i have to add to suppress it right?

Offline Aleksi "Lex" Kilpinen

  • A Peculiar Finn
  • Lead Support Specialist
  • SMF Super Hero
  • *
  • Posts: 17,586
  • Gender: Male
  • Don't worry, I'm n00b friendly
    • Aleksi.Kilpinen on Facebook
    • aleksi-kilpinen on LinkedIn
Re: How to resolve deprecated error?
« Reply #3 on: December 06, 2018, 01:28:10 AM »
That would be for php 7.2.0 specifically.

That's not really an ideal solution though, as it will only work on that specific version, and it will only stop SMF from logging the error. It won't do anything to stop your server still probably having thousands of those errors logged.

Something like
Code: [Select]
E_DEPRECATED && (version_compare(phpversion(), '7.2') >= 0) would probably be better for the version comparison.

Officially, SMF 2.0 does not support 7.2
A Finnish Support Specialist
 Happily running multiple SMF 2.0 installations.

How you can help SMF

"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum.
 Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

Offline SpacePhoenix

  • Semi-Newbie
  • *
  • Posts: 34
Re: How to resolve deprecated error?
« Reply #4 on: December 06, 2018, 01:51:09 AM »
Version 7.0 of PHO went EOL at the start of the week. Version 5.6 (the very last 5.x version) goes EOL at the end of this month. It might be worth the OP asking their host if they plan on migrating some or all of their servers over to a 7.x version of PHP and which one they intend to migrate to

Offline Aleksi "Lex" Kilpinen

  • A Peculiar Finn
  • Lead Support Specialist
  • SMF Super Hero
  • *
  • Posts: 17,586
  • Gender: Male
  • Don't worry, I'm n00b friendly
    • Aleksi.Kilpinen on Facebook
    • aleksi-kilpinen on LinkedIn
Re: How to resolve deprecated error?
« Reply #5 on: December 06, 2018, 01:54:26 AM »
Version 7.0 of PHO went EOL at the start of the week. Version 5.6 (the very last 5.x version) goes EOL at the end of this month. It might be worth the OP asking their host if they plan on migrating some or all of their servers over to a 7.x version of PHP and which one they intend to migrate to
Unless I am greatly mistaken, the error is _because_ the server has been migrated to 7.2. Not the other way around.
A Finnish Support Specialist
 Happily running multiple SMF 2.0 installations.

How you can help SMF

"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum.
 Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

Offline SpacePhoenix

  • Semi-Newbie
  • *
  • Posts: 34
Re: How to resolve deprecated error?
« Reply #6 on: December 06, 2018, 03:11:13 AM »
Version 7.0 of PHO went EOL at the start of the week. Version 5.6 (the very last 5.x version) goes EOL at the end of this month. It might be worth the OP asking their host if they plan on migrating some or all of their servers over to a 7.x version of PHP and which one they intend to migrate to
Unless I am greatly mistaken, the error is _because_ the server has been migrated to 7.2. Not the other way around.

It's possible that the OPs host might have some servers that won't be migrated to 7.2 (or at least have other PHP versions available), only the OPs host would know what the plans are for PHP version migration

Offline Aleksi "Lex" Kilpinen

  • A Peculiar Finn
  • Lead Support Specialist
  • SMF Super Hero
  • *
  • Posts: 17,586
  • Gender: Male
  • Don't worry, I'm n00b friendly
    • Aleksi.Kilpinen on Facebook
    • aleksi-kilpinen on LinkedIn
Re: How to resolve deprecated error?
« Reply #7 on: December 06, 2018, 03:29:58 AM »
That is true, and on any better host also likely.
A Finnish Support Specialist
 Happily running multiple SMF 2.0 installations.

How you can help SMF

"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum.
 Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

Offline a10

  • Charter Member
  • Sr. Member
  • *
  • Posts: 822
Re: How to resolve deprecated error?
« Reply #8 on: December 06, 2018, 06:19:21 AM »
7.1 works perfect for 2.0.15

Any host worthy of ones money offers some php version choice.
2.0.15, ssl, php 7.1.19, MySQL 10.1.30-MariaDB-1~xenial
Mods: Contact Page, Like Posts, Responsive Curve, Search Focus Dropdown.

Offline SpacePhoenix

  • Semi-Newbie
  • *
  • Posts: 34
Re: How to resolve deprecated error?
« Reply #9 on: December 06, 2018, 02:34:26 PM »
Back when 4 went EOL did every host migrate all their servers over to 5 very shortly afterwards?

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 69,678
    • StoryBB/StoryBB on GitHub
Re: How to resolve deprecated error?
« Reply #10 on: December 06, 2018, 02:52:23 PM »
No, it took YEARS. There’s plenty of hosting still on 5.3.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.