Bug 211607

Summary: lang/php56 5.6.24_1 - Default extension order causes segfault (imap + recode - need recode loaded first)
Product: Ports & Packages Reporter: Gary Carter <kithop>
Component: Individual Port(s)Assignee: Alex Dupre <ale>
Status: Closed Overcome By Events    
Severity: Affects Some People CC: brunoiseenhuftah, oss, w.schwarzenfeld
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   

Description Gary Carter 2016-08-05 18:13:00 UTC
Overview: The new automatic include system in php56 5.6.24_1 for PHP extensions is great, but I'd like to request that one of the extensions be moved later in the load order, to prevent a conflict that causes a segfault when starting e.g. php-fpm - 'recode' needs to come before 'imap'.

Steps to reproduce: When both 'imap' and 'recode' are enabled and installed, along with a service like php-fpm, php-fpm will segfault on startup ('exited on signal 11 (core dumped)').

Actual result: % sudo /usr/local/etc/rc.d/php-fpm restart   
Performing sanity check on php-fpm configuration:
Segmentation fault (core dumped)

Expected result: Proper service startup

Build Date & Hardware: php56 5.6.24_1 with both 'IMAP' and 'Recode' extensions / sub-ports enabled, php-fpm on FreeBSD 10.3-RELEASE-p6, amd64

Suggested Fix: Check if both 'imap' and 'recode' are enabled, and rename /usr/local/etc/php/ext-20-imap.ini to e.g. /usr/local/etc/php/ext-30-imap.ini so it loads after /usr/local/etc/php/ext-20-recode.ini - Tested, and this successfully works around the issue.

Thanks!
Comment 1 foudfou 2016-10-06 20:00:39 UTC
Same here for redis.so:

Starting php_fpm.
[06-Oct-2016 21:49:12] NOTICE: PHP message: PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20131226/redis.so' - /usr/local/lib/p
hp/20131226/redis.so: Undefined symbol &quot;php_session_create_id&quot; in Unknown on line 0

I always had to edit /usr/local/etc/php/extensions.ini to put redis.so at the end.

I'd suggest to rename extensions.ini 00-extensions.ini, and ext-30-redis.ini say 30-ext-redis.ini.
Comment 2 lordbruno 2016-10-20 16:18:57 UTC
Problem persists in php70 7.0.12. Default install of packages puts the loading of .ini files in such order that it segfaults on startup. Exact same symptoms as first post.
Comment 3 Walter Schwarzenfeld 2018-03-09 11:58:18 UTC
ping!