We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

The FPM crashes with PHP 5.6 + FPM + Nginx + Phalcon.

I installed the new PHP 5.6 + FPM+ Nginx but the FPM is always crashes when executing request to Phalcon app. If I trying to excite pure PHP file all works well... I don't know if it related to the issue, but I noticed that the cache (the volt cache dir) directory is always empty, but the cache dir have 777 permission... Please help, thanks....

This is a backtrace of PHP-FPM when crashes

[email protected] /]# gdb /usr/sbin/php-fpm /tmp/systemd-private-WENpSv/tmp/core-php-fpm.20298
GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-51.el7
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <link>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<link>...
Reading symbols from /usr/sbin/php-fpm...Reading symbols from /usr/sbin/php-fpm...(no debugging symbols found)...done.
(no debugging symbols found)...done.
[New LWP 20298]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by `php-fpm: pool www              '.
Program terminated with signal 11, Segmentation fault.
#0  0x00007f68eef1a785 in _zend_mm_realloc_int ()
Missing separate debuginfos, use: debuginfo-install php-fpm-5.6.0-1.el7.remi.x86_64
(gdb) bt
#0  0x00007f68eef1a785 in _zend_mm_realloc_int ()
#1  0x00007f68d84d635d in phalcon_concat_sv () from /usr/lib64/php/modules/phalcon.so
#2  0x00007f68d862484c in zim_Phalcon_Mvc_View_Engine_Volt_Compiler_attributeReader () from /usr/lib64/php/modules/phalcon.so
#3  0x00007f68eef3202b in dtrace_execute_internal ()
#4  0x00007f68e4bd3936 in xdebug_execute_internal (current_execute_data=0x7fffdafd4e70, fci=0x7fffdafd4fa0, return_value_used=1) at /var/tmp/xdebug/xdebug.c:1551
#5  0x00007f68eef33e04 in zend_call_function ()
#6  0x00007f68d84cb242 in phalcon_call_user_function () from /usr/lib64/php/modules/phalcon.so
#7  0x00007f68d84cbb17 in phalcon_call_class_method_aparams () from /usr/lib64/php/modules/phalcon.so
#8  0x00007f68d869899f in zim_Phalcon_Mvc_View_Engine_Volt_Compiler_expression () from /usr/lib64/php/modules/phalcon.so
#9  0x00007f68eef3202b in dtrace_execute_internal ()
#10 0x00007f68e4bd3936 in xdebug_execute_internal (current_execute_data=0x7fffdafd5480, fci=0x7fffdafd55b0, return_value_used=1) at /var/tmp/xdebug/xdebug.c:1551
#11 0x00007f68eef33e04 in zend_call_function ()
#12 0x00007f68d84cb242 in phalcon_call_user_function () from /usr/lib64/php/modules/phalcon.so
#13 0x00007f68d84cbb17 in phalcon_call_class_method_aparams () from /usr/lib64/php/modules/phalcon.so
#14 0x00007f68d85e321f in zim_Phalcon_Mvc_View_Engine_Volt_Compiler_compileEcho () from /usr/lib64/php/modules/phalcon.so
#15 0x00007f68eef3202b in dtrace_execute_internal ()
#16 0x00007f68e4bd3936 in xdebug_execute_internal (current_execute_data=0x7fffdafd59b0, fci=0x7fffdafd5ae0, return_value_used=1) at /var/tmp/xdebug/xdebug.c:1551
#17 0x00007f68eef33e04 in zend_call_function ()
#18 0x00007f68d84cb242 in phalcon_call_user_function () from /usr/lib64/php/modules/phalcon.so
#19 0x00007f68d84cbb17 in phalcon_call_class_method_aparams () from /usr/lib64/php/modules/phalcon.so
#20 0x00007f68d869629b in zim_Phalcon_Mvc_View_Engine_Volt_Compiler__statementList () from /usr/lib64/php/modules/phalcon.so
#21 0x00007f68eef3202b in dtrace_execute_internal ()
#22 0x00007f68e4bd3936 in xdebug_execute_internal (current_execute_data=0x7fffdafd5fb0, fci=0x7fffdafd60e0, return_value_used=1) at /var/tmp/xdebug/xdebug.c:1551
#23 0x00007f68eef33e04 in zend_call_function ()
#24 0x00007f68d84cb242 in phalcon_call_user_function () from /usr/lib64/php/modules/phalcon.so
#25 0x00007f68d84cbb17 in phalcon_call_class_method_aparams () from /usr/lib64/php/modules/phalcon.so
#26 0x00007f68d866ef63 in zim_Phalcon_Mvc_View_Engine_Volt_Compiler__compileSource () from /usr/lib64/php/modules/phalcon.so
#27 0x00007f68eef3202b in dtrace_execute_internal ()
#28 0x00007f68e4bd3936 in xdebug_execute_internal (current_execute_data=0x7fffdafd6520, fci=0x7fffdafd6650, return_value_used=1) at /var/tmp/xdebug/xdebug.c:1551
#29 0x00007f68eef33e04 in zend_call_function ()
#30 0x00007f68d84cb242 in phalcon_call_user_function () from /usr/lib64/php/modules/phalcon.so
#31 0x00007f68d84cbb17 in phalcon_call_class_method_aparams () from /usr/lib64/php/modules/phalcon.so
#32 0x00007f68d85571d7 in zim_Phalcon_Mvc_View_Engine_Volt_Compiler_compileFile () from /usr/lib64/php/modules/phalcon.so
#33 0x00007f68eef3202b in dtrace_execute_internal ()
#34 0x00007f68e4bd3936 in xdebug_execute_internal (current_execute_data=0x7fffdafd6a30, fci=0x7fffdafd6b60, return_value_used=1) at /var/tmp/xdebug/xdebug.c:1551
#35 0x00007f68eef33e04 in zend_call_function ()
#36 0x00007f68d84cb242 in phalcon_call_user_function () from /usr/lib64/php/modules/phalcon.so
#37 0x00007f68d84cbb17 in phalcon_call_class_method_aparams () from /usr/lib64/php/modules/phalcon.so
#38 0x00007f68d8604bde in zim_Phalcon_Mvc_View_Engine_Volt_Compiler_compile () from /usr/lib64/php/modules/phalcon.so
#39 0x00007f68eef3202b in dtrace_execute_internal ()
#40 0x00007f68e4bd3936 in xdebug_execute_internal (current_execute_data=0x7fffdafd7070, fci=0x7fffdafd71a0, return_value_used=1) at /var/tmp/xdebug/xdebug.c:1551
#41 0x00007f68eef33e04 in zend_call_function ()
#42 0x00007f68d84cb242 in phalcon_call_user_function () from /usr/lib64/php/modules/phalcon.so
#43 0x00007f68d84cbb17 in phalcon_call_class_method_aparams () from /usr/lib64/php/modules/phalcon.so
#44 0x00007f68d85fd98c in zim_Phalcon_Mvc_View_Engine_Volt_render () from /usr/lib64/php/modules/phalcon.so
#45 0x00007f68eef3202b in dtrace_execute_internal ()
#46 0x00007f68e4bd3936 in xdebug_execute_internal (current_execute_data=0x7fffdafd7570, fci=0x7fffdafd76a0, return_value_used=1) at /var/tmp/xdebug/xdebug.c:1551
#47 0x00007f68eef33e04 in zend_call_function ()
#48 0x00007f68d84cb242 in phalcon_call_user_function () from /usr/lib64/php/modules/phalcon.so
#49 0x00007f68d84cbb17 in phalcon_call_class_method_aparams () from /usr/lib64/php/modules/phalcon.so
#50 0x00007f68d86434ff in zim_Phalcon_Mvc_View__engineRender () from /usr/lib64/php/modules/phalcon.so
#51 0x00007f68eef3202b in dtrace_execute_internal ()
#52 0x00007f68e4bd3936 in xdebug_execute_internal (current_execute_data=0x7fffdafd7b60, fci=0x7fffdafd7c90, return_value_used=1) at /var/tmp/xdebug/xdebug.c:1551
#53 0x00007f68eef33e04 in zend_call_function ()
#54 0x00007f68d84cb242 in phalcon_call_user_function () from /usr/lib64/php/modules/phalcon.so
#55 0x00007f68d84cbb17 in phalcon_call_class_method_aparams () from /usr/lib64/php/modules/phalcon.so
#56 0x00007f68d863d84b in zim_Phalcon_Mvc_View_render () from /usr/lib64/php/modules/phalcon.so
#57 0x00007f68eef3202b in dtrace_execute_internal ()
#58 0x00007f68e4bd3936 in xdebug_execute_internal (current_execute_data=0x7fffdafd8180, fci=0x7fffdafd82b0, return_value_used=1) at /var/tmp/xdebug/xdebug.c:1551
#59 0x00007f68eef33e04 in zend_call_function ()
#60 0x00007f68d84cb242 in phalcon_call_user_function () from /usr/lib64/php/modules/phalcon.so
#61 0x00007f68d84cbb17 in phalcon_call_class_method_aparams () from /usr/lib64/php/modules/phalcon.so
#62 0x00007f68d85e6532 in zim_Phalcon_Mvc_Application_handle () from /usr/lib64/php/modules/phalcon.so
#63 0x00007f68eef3202b in dtrace_execute_internal ()
---Type <return> to continue, or q <return> to quit---
#64 0x00007f68e4bd3936 in xdebug_execute_internal (current_execute_data=0x7f68eecb4a58, fci=0x0, return_value_used=1) at /var/tmp/xdebug/xdebug.c:1551
#65 0x00007f68eefea548 in zend_do_fcall_common_helper_SPEC ()
#66 0x00007f68eef80148 in execute_ex ()
#67 0x00007f68eef31f09 in dtrace_execute_ex ()
#68 0x00007f68e4bd2ebc in xdebug_execute_ex (execute_data=0x7f68eecb4a58) at /var/tmp/xdebug/xdebug.c:1437
#69 0x00007f68eef44f1b in zend_execute_scripts ()
#70 0x00007f68eeee09b5 in php_execute_script ()
#71 0x00007f68eedc583f in main ()


98.9k

It's reallocating an interned string. I'll add a fix in the 1.3.3 branch



19.1k

Ok, thanks



19.1k

Sorry, but I'm confused. The fix now is in the 1.3.3 branch, right? But 1.3.3 is not official released, so I can't use PHP5.6 with Pahlcon in production because the 1.3.3 is under development.

Is there any chance that this fix will be included in to currently official resale of Phalcon?



26.3k

Is this bug relevant in terms of installing Phalcon with PHP 5.6 on Apache under Debian 7 Wheezy?



19.1k

I thinks YES, this bug was reproduced on CentOS6.5, CentOS7 and on Ubuntu 14.04, so probably it will reproduced as well on Debian 7 Wheezy....



26.3k

But this bug occurs when you have PHP with FPM, am I right? What if I don't have FPM?

To be honest I don't know what FPM really is. I have simply installed PHP, Apache nad MySQL on Debian 7 following a [https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-debian](this tutorial) from Digital Ocean. Then I have upgraded PHP to 5.6 using a [https://packages.dotdeb.org/dists/wheezy-php56/](this package) from Dotdeb.org.

And I am trying to study what to do know to install Phalcon...



19.1k

You are right, this bug is related to setup when you bind your web server to the PHP by FPM, so if you didn't installed and configured the FPM probably this bug is not relevant for your setup.

The segfault will occurs with all SAPI (cli, mod_php, fpm...) So, as soon as you use PHP 5.6, you need the 1.3.2 + patches



26.3k
edited Sep '14

@remicollet

What is that mean " + patches"? That e.g. I can compile 1.3.2 version on my own? Or that I need to write patches on my own? I don't know C : /

If you don't understand what "1.3.2+patches" means, probably you have to wait for 1.3.3