rryqszq4 / ngx-php

ngx-php - Embedded php7 or php8 scripting language for nginx module. Mainline development version of the ngx-php.
BSD 2-Clause "Simplified" License
582 stars 56 forks source link

ngx_var_get nginx Signal 11 #175

Open Qwoker opened 11 months ago

Qwoker commented 11 months ago

Hello! Where i call ngx_var_get with undefined var name example ngx_var_get("fijadsasd") or ngx_var_get("test33") (this variables is null and not set in nginx) i try open page and got crash nginx with signal 11

joanhey commented 11 months ago

ngx_var_get() and ngx_var_set() are for the nginx variables, nothing from PHP.

https://www.javatpoint.com/nginx-variables

If in an nginx config, you call a variable that is NOT set before, you will always get a signal 11 error. With or without ngx-php.

Qwoker commented 11 months ago

ngx_var_get() and ngx_var_set() are for the nginx variables, nothing from PHP.

https://www.javatpoint.com/nginx-variables

If in an nginx config, you call a variable that is NOT set before, you will always get a signal 11 error. With or without ngx-php.

everything is correct if I call a function with a non-existent variable in nginx i got crash with signal 11 UPD: if i try call NULL variable on nginx a got "nil", but in PHP i got crashed with signal 11

joanhey commented 11 months ago

I'll add a test for null variables. And if needed a fix.

Qwoker commented 11 months ago

I'll add a test for null variables. And if needed a fix.

I check sources PHP ZEND on repository. I found only RETURN_NULL(); but i don't know why nginx got crash.

If you know how fix it? do it, please)