preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead

DarkViper

preg_replace with modifier 'e' only works with deprecated messages from PHP-5.5 and no longer at all from PHP-7.
In order to keep preg_replace 'e' executable under PHP-7, it must be exchanged for preg_replace_callback and the code to be executed converted into a callback function.

See: php.net
Quote from: php.net pcre modifier 'e'
e (PREG_REPLACE_EVAL)
    Warning

    This feature was DEPRECATED in PHP 5.5.0, and REMOVED as of PHP 7.0.0.
[url=http://www.youtube.com/watch?v=tmzDAz6ZvFQ]Der blaue Planet[/url] - er ist nicht unser Eigentum - wir haben ihn nur von unseren Nachkommen geliehen[br]
[i]"You have to take the men as they are... but you can not leave them like that !" :-P [/i]
[i]Das tägliche Stoßgebet: [b]Oh Herr, wirf Hirn vom Himmel ![/b][/i]

svsanchez

Regarding the original problem:

PHP Deprecated:  preg_replace(): The /e modifier is deprecated, use preg_replace_callba ck instead in /home/deguatec/public_html/modules/show_menu2/include.php on line 216

After checking soem not so big error log files, I noticed that this error stopped at the end of June, so I think it must have been a problem due to the PHP version. I had decided to upgrade my site to 2.12.x and changed the PHP version to 7.1, but since my previous attempts have made the site incredibly slow, I decided to stick with version 2.8.3 until a solution is found for big sites and forgot to change my php version back to 5.6.

So, if you encounter that error, check your php version.


hgs

LG Harald

"Fange nie an, aufzuhören - höre nie auf, anzufangen." Marcus Tullius Cicero (106-43 v.Chr.)

svsanchez

Ok, so I installed it on the test domain. Where do I send the login credentials?

svsanchez

Hello dbs and hgs, thank you both for your help.

I am making a copy of the site on the same server but with another domain.

1) I will upload it as it is right now (version 2.8.3) so that you can see how slow the front end becomes once it is upgraded.

2) Also, you will see how the backend becomes slow because of the big size of the site (I use a mod by Ruud to open only the pages current level (siblings), which is discussed here:

https://forum.websitebaker.org/index.php/topic,25587.msg174593.html#msg174587

hgs

2nd possibility
You transfer the website and the database dump to our FTP server and we look at the problems.
If you are interested, send me a PM
problem with this, we can't test it at your hoster, which is probably partly responsible for the slowdown
Therefore only as 2nd possibility.
LG Harald

"Fange nie an, aufzuhören - höre nie auf, anzufangen." Marcus Tullius Cicero (106-43 v.Chr.)

dbs

Hello, you can do this:
- create a copy of your site in a subdomain and give us access to find the problems
  - also for upgrade test is this the best way
- or deactivate the error logging in your WB Settings

I hope it is clear you can't use your old system with the newest databases or PHP versions.
You have to upgrade.
[url="https://onkel-franky.de"]https://onkel-franky.de[/url]

svsanchez

Hello.

I just noticed that I have thousands upon thousands of messages like this in all my error logs:

[28-Aug-2020 08:18:39 UTC] PHP Deprecated:  preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/deguatec/public_html/modules/show_menu2/include.php on line 216

A LITTLE INFO ABOUT MY SITE:

1) First of all, sorry to publish here, but I couldn't find the create new post in the WB 2.8.x forum

2) My site is www.deguate.com.gt

3) I am still using WB 2.8.3 because when I upgraded to 2.10.x or 2.12.x my site became horribly slow (1 minute to start showing the pages). I tried upgrading several times with the same result in speed, don't know why.

4) I found a topic talking about a patch for this problem (https://forum.websitebaker.org/index.php/topic,27343.msg188689.html#msg188689), but the resource seems to not exist anymore (https://code.google.com/archive/p/wbcom/)

5) My site has sveral hundred categoris and subcategories. Each one of them has an error log. Depending on the traffic of the pages on the category, the error log on each of them can grow to few thousand bytes to more than 1GB in a month, so I need to fix this ASAP to stop utilizing all my hosting space in error logs!

Thank you!