Forums / Installing on a Linux/Unix Server / PHP 7.3 preg_xxxxx Warnings

PHP 7.3 preg_xxxxx Warnings

Views: 9,933

Results 1 to 5 of 5
27 Jun 2019, 9:18 PM
#1
mc12345678 avatar

mc12345678

Totally Zenned

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

PHP 7.3 preg_xxxxx Warnings

Basically running Zen Cart version 1.5.6b plus a few additional corrections which means also basically ZC 1.5.7 on PHP 7.3.6, Apache Linux 4.14.117-grsec-grsec+, PHP memory limit just increased from 96M to 128M to try to remove the generation of warnings like described below (no effect).

Searched the internet and it seems that the solution to this is to modify the php.ini to disable pcre.jit... After I modified my php.ini to disable pcre.jit, the messages were no longer being generated, but now I wonder if there is some other effect such as a performance hit or something.

Anyways, these are examples of warnings I was receiving in a single mydebug log working in the above environment just by accessing admin/server_info.php:

PHP Warning:  preg_replace(): JIT compilation failed: no more memory in admin/includes/extra_configures/enable_error_logging.php on line 38
PHP Warning:  preg_match(): JIT compilation failed: no more memory in admin/includes/initsystem.php on line 30
PHP Warning:  preg_replace(): JIT compilation failed: no more memory in includes/classes/db/mysql/query_factory.php on line 84
PHP Warning:  preg_match(): JIT compilation failed: no more memory in admin/includes/extra_configures/enable_error_logging.php on line 20
PHP Warning:  preg_match(): JIT compilation failed: no more memory in includes/classes/db/mysql/query_factory.php on line 475
PHP Warning:  preg_replace(): JIT compilation failed: no more memory in includes/functions/sessions.php on line 143
PHP Warning:  preg_replace(): JIT compilation failed: no more memory in admin/includes/functions/general.php on line 3767
PHP Warning:  preg_replace(): JIT compilation failed: no more memory in admin/includes/init_includes/init_templates.php on line 35
PHP Warning:  preg_replace_callback(): JIT compilation failed: no more memory in includes/classes/class.base.php on line 136
PHP Warning:  preg_match_all(): JIT compilation failed: no more memory in admin/includes/classes/class.admin.zcObserverLogEventListener.php on line 185
PHP Warning:  preg_replace(): JIT compilation failed: no more memory in admin/includes/functions/general.php on line 136
PHP Warning:  preg_replace(): JIT compilation failed: no more memory in admin/includes/functions/general.php on line 137
PHP Warning:  preg_replace(): JIT compilation failed: no more memory in admin/includes/classes/class.admin.zcObserverLogEventListener.php on line 140
PHP Warning:  preg_match(): JIT compilation failed: no more memory in admin/includes/init_includes/init_errors.php on line 210
PHP Warning:  preg_split(): JIT compilation failed: no more memory in admin/includes/functions/general.php on line 1142
PHP Warning:  preg_replace(): JIT compilation failed: no more memory in includes/functions/plugin_support.php on line 63
PHP Warning:  preg_match(): JIT compilation failed: no more memory in includes/classes/db/mysql/query_factory.php on line 488

Again to correct this, I added to my php.ini file (or equivalent file to assign php settings):

pcre.jit = 0

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

28 Jun 2019, 4:54 AM
#2
gernot avatar

gernot

Zen Follower

Join Date:
Feb 2017
Location:
Tokyo, Japan
Posts:
334
Plugin Contributions:
0

Re: PHP 7.3 preg_xxxxx Warnings

Hi,
Interesting issue! I wonder if this has to do with PCRE to PCRE2 migration in PHP7.3 and the need to do checks of regexps for compatibility (like escaping hyphens), since PHP does not do linting of regexps at lint time.

Zen Cart 1.5.6c modified for Japanese language support. Upgraded incrementally from initial 1.5.5d. Currently planning direct upgrade to 2.1.0

28 Jun 2019, 5:05 AM
#3
gernot avatar

gernot

Zen Follower

Join Date:
Feb 2017
Location:
Tokyo, Japan
Posts:
334
Plugin Contributions:
0

Re: PHP 7.3 preg_xxxxx Warnings

Just a though, do preg_match statements need '/ ... /' surrounding the regexp?
(face palm, I see ... stands in for /.../)
I also see it is reported as PHP bug.

Zen Cart 1.5.6c modified for Japanese language support. Upgraded incrementally from initial 1.5.5d. Currently planning direct upgrade to 2.1.0

28 Jun 2019, 7:56 AM
#4
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,720
Plugin Contributions:
56

Re: PHP 7.3 preg_xxxxx Warnings

mc12345678:

Again to correct this, I added to my php.ini file (or equivalent file to assign php settings):

pcre.jit = 0


Yep, did same thing.  For MAMP users, this will be File->Edit Template->PHP->[Current version from Main Window]-> search for this setting and update it as shown above.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

28 Jun 2019, 12:41 PM
#5
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: PHP 7.3 preg_xxxxx Warnings

Thoughts on this being something attempted to be set in the loading of Zen Cart? Is it something that can/should otherwise be resolved by some sort of code change to allow the just-in-time loading and not experience the out-of-memory issue?

I mean, loading the server_info page really doesn't do much in way of complex work other than loading the admin header, putting a few things together for the upper page display and then the output of phpinfo(). Most of what is provided above as warning points is cleaning up the provided data. Yes that's pretty much what the preg_ functions are for, just saying.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...