Today, we saw such a Bug in the Drupal community. When PHP5.3.10 is used on Windows, if the string length of a PHP file is a multiple of 4096, running or calling this PHP file will cause a PHP crash. PHP official bug page in bugs. php. netbug. php? I tested the bug in id60758, so I went to the local wi
Today, we saw such a Bug in the Drupal community. When PHP is 5.3.10 on Windows, if the string length of a PHP file is exactly a multiple of 4096, running or calling this PHP file will cause a PHP crash. PHP official bug page in https://bugs.php.net/bug.php? Id = 60758 testing the bug, so I went to the local wi
Today, we saw such a Bug in the Drupal community.
When a PHP file is in PHP <= 5.3.10 on Windows, if the string length of a PHP file is exactly a multiple of 4096, running or calling this PHP file will directly cause a PHP crash.
PHP official bug page in https://bugs.php.net/bug.php? Id = 60758
Test bug
So I did this test on windows on the local machine. It is amazing that PHP 5.3.9 and PHP 5.3.10 have this bug, but PHP 5.3.8 does not.
The following code is used:
To solve the problem, you must Upgrade PHP or prevent the string length of the PHP file from being a multiple of 4096.
I assume that upgrading PHP is the best solution. If not, you have to modify your PHP file.
PHP Solution
When writing a PHP file, determine the PHP version and the file String Length in advance.
Condition determination:
- Version_compare (PHP_VERSION, '5. 3.10 ',' <= '). This Code indicates that the PHP version is smaller than or equal to 5.3.10.
- ! (Strlen ($ data) % 4096). This Code indicates that the string length is a multiple of 4096.
When conditions are met, use the regular expression in
(...)
Read the rest of fixed the bug (67 words) when the PHP file string length is multiples of 4096)
©Lixiphp for LixiPHP-dedicated to advanced PHP programming !, 2013. | Permalink | No comment | Add to del. icio. us
Post tags: Bug, PHP, PHP 5.3.10, PHP 5.3.9
Feed enhanced by Better Feed from Ozh