[pmwiki-users-fr] preg_match() error in apache.log

Petko Yotov 5ko at 5ko.fr
Mer 27 Mai 07:13:48 PDT 2026


Pour un serveur à la maison qui n'est pas accessible depuis le monde 
entier, j’enlèverai la restriction dans sudo systemctl edit apache2 :

   [Service]
   MemoryDenyWriteExecute=no

Sinon, soit installer php8.5-fpm, soit mettre dans php.ini :

   pcre.jit=0

Il faut le faire dans php.ini et non dans config.php avec ini_set, car 
l'expression régulière est évaluée avant l'inclusion de config.php.

Petko

On 27/05/2026 12:43, ooioo wrote:
> dans /var/log/apache2/error.log j'ai beaucoup d'erreurs
> 
> ... PHP Warning:  preg_match(): Allocation of JIT memory failed, PCRE
> JIT will be disabled. This is likely caused by security restrictions.
> Either grant PHP permission to allocate executable memory, or set
> pcre.jit=0 in /var/www/html/wikihome/pmwiki.php on line 48
> 
> la ligne 48 de pmwiki.php est :       if
> (preg_match('!^phar://[^:]*$!', $FarmD)) {
> 
> mon server est un mini server intel n100 hébergé chez moi, ubuntu
> server 26.04, php 8.5.4, apache2.
> 
> j'ai lancé
> 
> # systemctl cat apache2 | grep MemoryDeny
>     MemoryDenyWriteExecute=yes
> 
> Ce problème est analysé ici :
> 
> https://github.com/php/php-src/issues/21450
> 
> avec les conclusions :
> 
>  	* If you use PHP with as php-fpm, (the modern way), then you're OK.
>  	* If you still use mod-php, then ini_set("pcre.jit",0); to remove
> the warning, and accept slightly reduced performance.
>  	* Or, you _could_ consider removing the systemd restriction as
> above. (MemoryDenyWriteExecute=no)
> 
> Qu'en pensez vous  ?



Plus d'informations sur la liste de diffusion pmwiki-users-fr