How to resolve deprecated error?

Started by La_Lafayette, December 06, 2018, 01:05:57 AM

Previous topic - Next topic

La_Lafayette

hxxp:i.gyazo.com/68feeb1db8724c8ba89ab7b4504a1cd0.png [nonactive]


I'm at a loss with this error

using SMF 2.0.15

Aleksi "Lex" Kilpinen

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
Slava
Ukraini!
"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

How you can help SMF

La_Lafayette

// 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?

Aleksi "Lex" Kilpinen

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 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
Slava
Ukraini!
"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

How you can help SMF

SpacePhoenix

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

Aleksi "Lex" Kilpinen

Quote from: SpacePhoenix 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
Unless I am greatly mistaken, the error is _because_ the server has been migrated to 7.2. Not the other way around.
Slava
Ukraini!
"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

How you can help SMF

SpacePhoenix

Quote from: Aleksi "Lex" Kilpinen on December 06, 2018, 01:54:26 AM
Quote from: SpacePhoenix 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
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

Aleksi "Lex" Kilpinen

That is true, and on any better host also likely.
Slava
Ukraini!
"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

How you can help SMF

a10

7.1 works perfect for 2.0.15

Any host worthy of ones money offers some php version choice.
2.0.19, php 8.0.23, MariaDB 10.5.15. Mods: Contact Page, Like Posts, Responsive Curve, Search Focus Dropdown, Add Join Date to Post.

SpacePhoenix

Back when 4 went EOL did every host migrate all their servers over to 5 very shortly afterwards?

Arantor

No, it took YEARS. There's plenty of hosting still on 5.3.

Advertisement: