Bug #72043 [Opn]: preg_match restart Apache (Not with PHP 7.0.x or 5.5.x)
| From: | dominique at ottello dot net | Date: | Mon, 18 Apr 2016 08:15:14 +0000 |
| Subject: | Bug #72043 [Opn]: preg_match restart Apache (Not with PHP 7.0.x or 5.5.x) | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-200621@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=72043&edit=1
ID: 72043
User updated by: dominique at ottello dot net
Reported by: dominique at ottello dot net
Summary: preg_match restart Apache (Not with PHP 7.0.x or
5.5.x)
Status: Open
Type: Bug
Package: Apache related
Operating System: Windows 7 64bit
PHP Version: 5.6.20
Block user comment: N
Private report: N
New Comment:
The problem was detected with the 32-bit versions of Apache and PHP, but is exactly the same with
64-bit versions.
Previous Comments:
------------------------------------------------------------------------
[2016-04-17 12:28:42] dominique at ottello dot net
Description:
------------
Execution of this code works fine with Apache 2.4.16 to 2.4.20 and PHP 5.3.29, 5.4.45, 5.5.30 or
7.0.5 but crash and restart Apache with PHP 5.6.15 to 5.6.20
AH00428: Parent: child process 5912 exited with status 255 -- Restarting.
All things otherwise identical, the problem occurs only with PHP 5.6.15 to 5.6.20. I have not tested
with versions prior to 5.6.15.
Test script:
---------------
$c_vhostConfFile = 'myfile.conf';
//myfile.conf is a copy of:
//$c_vhostConfFile = 'j:/wamp/bin/apache/apache2.4.20/conf/extra/httpd-vhosts.conf';
$myVhostsContents = file_get_contents($c_vhostConfFile);
// ServerName to find
$server = "wampserver.aviatechno";
$p_value = preg_quote($server);
$mask = "{
<VirtualHost # beginning of VirtualHost
((?!</VirtualHost>).)* # avoid premature end
\n\s*ServerName\s+${p_value}\s*\n # Test server name
.*? # we stop as soon as possible
</VirtualHost>\s*\n # end of VirtualHost
}isx";
if(preg_match($mask, $myVhostsContents, $VirtualHost_match) !== false)
echo "<pre>".htmlspecialchars($VirtualHost_match[0])."</pre>\n";
else
echo "<p>preg_match error</p>\n";
?>
Expected result:
----------------
The whole content of the VirtualHost definition that is:
<VirtualHost *:80>
DocumentRoot "G:/www/wampserver"
ServerAdmin webmaster@ottello.net
ServerAlias www.wampserser.aviatechno
ServerName wampserver.aviatechno
<Directory "G:/www/wampserver/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride all
Require local
</Directory>
</VirtualHost>
Actual result:
--------------
Apache crash and restart. No error in php_error.log
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=72043&edit=1