Edit report at https://bugs.php.net/bug.php?id=71273&edit=1
ID: 71273
Updated by: ab@php.net
Reported by: tlegall at easycom-aura dot com
Summary: A wrong ext directory setup in php.ini leads to
crash
Status: Assigned
Type: Bug
Package: Reproducible crash
Operating System: Windows
PHP Version: 7.0.1
Assigned To: ab
Block user comment: N
Private report: N
New Comment:
@tlegall yeah, except you build php yourself with VC11, a VC14 Apache build is required. You can
grab one from apachelounge.com fe.
Generally PHP7 is built and tested with VC14, VC11 should not be used (and not sure it'll work
already).
Thanks.
Previous Comments:
------------------------------------------------------------------------
[2016-01-04 13:45:21] tlegall at easycom-aura dot com
I am using apache 2.4.9 built with VC11.
Another thing that might be relevant, is that my system is in French, therefore the message for
missing module contains the é character. Here is the actual content of the buffer variable:
Unable to load dynamic library 'c/wamp/bin/php/php7.0.1/ext\php_Easycom7_0_0.dll' - Le
module spécifié est introuvable.
I'll try with a VC14 apache
------------------------------------------------------------------------
[2016-01-04 13:35:55] ab@php.net
@tlegall i'm not repro it as well with just setting extension_dir=c/... Could you maybe post
your full php.ini, maybe there's something else is involved?
Another question - which Apache builds do you use? Are they done VC14?
Thanks.
------------------------------------------------------------------------
[2016-01-04 11:45:49] laruence@php.net
can not reproduce on Linux, @welting could you please have a look into this?
------------------------------------------------------------------------
[2016-01-04 09:53:20] tlegall at easycom-aura dot com
Description:
------------
A wrongly configured extension_dir in the php.ini leads to a crash of apache, without any error
message.
I am using the latest 7.0.1 version from http://windows.php.net/, thread safe x86.
Test script:
---------------
Here is the line of the php.ini causing problems (missing : after the drive name)
; Directory in which the loadable extensions (modules) reside.
; http://php.net/extension-dir
; extension_dir = "./"
; On windows:
extension_dir = "c/wamp/bin/php/php7.0.1/ext"
Expected result:
----------------
Should log a warning indicating that the extensions cannot be found
Actual result:
--------------
Crash at the line 728 of main/main.c
The problem seems to come from the following code snippet, lines 724 - 729:
if (PG(html_errors)) {
replace_buffer = php_escape_html_entities((unsigned char*)buffer, buffer_len, 0, ENT_COMPAT,
NULL);
efree(buffer);
buffer = ZSTR_VAL(replace_buffer);
buffer_len = (int)ZSTR_LEN(replace_buffer);
}
replace_buffer is null, which leads to the crash of the ZSTR_LEN function.
Backtrace:
>
php7ts.dll!php_verror(const char * docref, const char * params, int type, const char * format, char
* args) Ligne 728 C
php7ts.dll!php_error_docref0(const char * docref, int type, const char * format, ...) Ligne 896 C
php7ts.dll!php_load_extension(char * filename, int type, int start_now) Ligne 137 C
php7ts.dll!php_load_php_extension_cb(void * arg) Ligne 344 C
php7ts.dll!php_ini_register_extensions() Ligne 739 C
php7apache2_4.dll!php_apache_server_startup(apr_pool_t * pconf, apr_pool_t * plog, apr_pool_t *
ptemp, server_rec * s) Ligne 465 C
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=71273&edit=1