ngx-php icon indicating copy to clipboard operation
ngx-php copied to clipboard

ngx_var_get nginx Signal 11

Open ghost opened this issue 2 years ago • 4 comments

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

ghost avatar Aug 06 '23 15:08 ghost

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.

joanhey avatar Aug 07 '23 16:08 joanhey

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

Qwoker avatar Aug 07 '23 16:08 Qwoker

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

joanhey avatar Aug 07 '23 18:08 joanhey

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)

Qwoker avatar Aug 07 '23 19:08 Qwoker