Troubles setting up with apache 2.4 and php-fpm 7.1


#1

TT-RSS hangs at 30% loading or shows blank page. php-fpm keeps crashing with signal 11 (SIGSEGV). Only hint I can get is from tt-rss log that it tries to allocate an astronomous amount of memory in sessions.php:

E_ERROR (1)	include/sessions.php:140 Allowed memory size of 268435456 bytes exhausted (tried to allocate 141733920797 bytes)
E_ERROR (1)	include/sessions.php:140 Allowed memory size of 134217728 bytes exhausted (tried to allocate 103484611256 bytes)

php-fpm.log:

[12-Jul-2017 18:01:05] WARNING: [pool ttrss.DOMAIN.TLD] child 85971 exited on signal 11 (SIGSEGV) after 0.713789 seconds from start
[12-Jul-2017 18:01:05] NOTICE: [pool ttrss.DOMAIN.TLD] child 85972 started
[12-Jul-2017 18:01:06] WARNING: [pool ttrss.DOMAIN.TLD] child 85972 exited on signal 11 (SIGSEGV) after 0.920165 seconds from start
[12-Jul-2017 18:01:06] NOTICE: [pool ttrss.DOMAIN.TLD] child 85973 started

apache error log:

[Wed Jul 12 18:01:05.770728 2017] [proxy_fcgi:error] [pid 1325:tid 34477451264] [client 192.168.13.246:60712] AH01067: Failed to read FastCGI header, referer: https://ttrss.DOMAIN.TLD/
[Wed Jul 12 18:01:05.777377 2017] [proxy_fcgi:error] [pid 1325:tid 34477451264] (70014)End of file found: [client 192.168.13.246:60712] AH01075: Error dispatching request to : , referer: https://ttrss.DOMAIN.TLD/
[Wed Jul 12 18:01:06.694998 2017] [proxy_fcgi:error] [pid 1324:tid 34477444864] [client 192.168.13.246:60708] AH01067: Failed to read FastCGI header
[Wed Jul 12 18:01:06.695206 2017] [proxy_fcgi:error] [pid 1324:tid 34477444864] (70014)End of file found: [client 192.168.13.246:60708] AH01075: Error dispatching request to :

apache access log:

192.168.13.246 - - [12/Jul/2017:18:01:05 +0200] "GET / HTTP/1.1" 200 174208
192.168.13.246 - - [12/Jul/2017:18:01:05 +0200] "GET /themes/default.php?1499773139 HTTP/1.1" 200 156
192.168.13.246 - - [12/Jul/2017:18:01:05 +0200] "GET /errors.php?1499773138&mode=js HTTP/1.1" 503 299
192.168.13.246 - - [12/Jul/2017:18:01:05 +0200] "GET /css/tt-rss.css?1499873450 HTTP/1.1" 304 -
192.168.13.246 - - [12/Jul/2017:18:01:05 +0200] "GET /css/dijit.css?1499873450 HTTP/1.1" 304 -
192.168.13.246 - - [12/Jul/2017:18:01:06 +0200] "GET /css/cdm.css?1499873450 HTTP/1.1" 304 -
192.168.13.246 - - [12/Jul/2017:18:01:06 +0200] "GET /lib/dojo/nls/tt-rss-layer_de.js?1499875266125 HTTP/1.1" 200 5350
192.168.13.246 - - [12/Jul/2017:18:01:06 +0200] "GET /errors.php?1499773138&mode=js HTTP/1.1" 200 970
192.168.13.246 - - [12/Jul/2017:18:01:06 +0200] "GET /lib/dijit/form/MultiSelect.js?1499875266125 HTTP/1.1" 200 2366
192.168.13.246 - - [12/Jul/2017:18:01:06 +0200] "GET /lib/dijit/form/ComboBox.js?1499875266125 HTTP/1.1" 200 168
192.168.13.246 - - [12/Jul/2017:18:01:06 +0200] "GET /js/FeedTree.js?1499875266125 HTTP/1.1" 200 16457
192.168.13.246 - - [12/Jul/2017:18:01:06 +0200] "GET /lib/dojo/selector/lite.js?1499875266125 HTTP/1.1" 200 4468
192.168.13.246 - - [12/Jul/2017:18:01:06 +0200] "GET /lib/dojo/resources/blank.gif?1499875266125 HTTP/1.1" 200 43
192.168.13.246 - - [12/Jul/2017:18:01:06 +0200] "POST /backend.php HTTP/1.1" 503 299

System: FreeBSD 11, apache 2.4.26, php 7.1.7, mysql via mariadb
tt-rss: commit c9040c5c2e3960cd3668dd0cfe7621c5536ed37e

Apache Settings for Virtual Host:

<Directory "/usr/local/www/tt-rss">
        DirectoryIndex index.php
        Options -Indexes
        Options +FollowSymLinks
        AllowOverride All
        Require all granted
</Directory>
<Directory /var/www/html/tt-rss/cache>
    Require all denied
</Directory>

<Directory /var/www/html/tt-rss>
    <Files "config.php">
        Require all denied
    </Files>
</Directory>
<VirtualHost _default_:80>
        ServerName ttrss.DOMAIN.TLD
        Redirect permanent / https://ttrss.DOMAIN.TLD/
</VirtualHost>
<VirtualHost _default_:443>
        DocumentRoot "/usr/local/www/tt-rss"
        ServerName ttrss.DOMAIN.TLD:443
        ServerAdmin webmin@DOMAIN.TLD
        ErrorLog "/var/log/httpd-ttrss.DOMAIN.TLD-error.log"
        TransferLog "/var/log/httpd-ttrss.DOMAIN.TLD-access.log"
        SSLEngine on
        SSLCertificateFile "/usr/local/etc/apache24/server.crt"
        SSLCertificateKeyFile "/usr/local/etc/apache24/server.key"
        <FilesMatch "\.(cgi|shtml|phtml|php)$">
            SSLOptions +StdEnvVars
        </FilesMatch>
        BrowserMatch "MSIE [2-5]" \
                 nokeepalive ssl-unclean-shutdown \
                 downgrade-1.0 force-response-1.0
        CustomLog "/var/log/httpd-ttrss.DOMAIN.TLD-ssl_request.log" \
                  "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"

        ProxyFCGIBackendType GENERIC
        <Proxy "fcgi://ttrss.DOMAIN.TLD" disablereuse=on retry=0>
        </Proxy>
        <FilesMatch \.php$>
                <If "-f %{REQUEST_FILENAME}">
                        SetHandler "proxy:unix:/var/run/php-fpm-ttrss.DOMAIN.TLD.sock|fcgi://ttrss.DOMAIN.TLD"
                </If>
        </FilesMatch>
#       ProxyPassMatch ^/(.*\.php(/.*)?)$ unix:/var/run/php-fpm-ttrss.DOMAIN.TLD.sock|fcgi://ttrss.DOMAIN.TLD/usr/local/www/tt-rss/
</VirtualHost>

fpm pool (without comments):

[ttrss.DOMAIN.TLD]
user = www-ttrss
group = www-ttrss
listen = /var/run/php-fpm-ttrss.DOMAIN.TLD.sock
listen.owner = www-ttrss
listen.group = www
listen.mode = 0660
 
pm = ondemand
pm.max_children = 8
pm.start_servers = 1
pm.min_spare_servers = 1
pm.max_spare_servers = 2
pm.process_idle_timeout = 10s;
pm.max_requests = 500
catch_workers_output = yes
security.limit_extensions = .php .php3 .php4 .php5 .php7
php_admin_value[open_basedir] = "/usr/local/www/tt-rss:/tmp/ttrss.DOMAIN.TLD:/tmp/mysqlsock"
php_admin_value[sys_temp_dir] = /tmp/ttrss.DOMAIN.TLD
php_admin_value[opcache.max_accelerated_files] = 4096
php_admin_value[extension] = session.so
php_admin_value[extension] = bcmath.so
php_admin_value[extension] = ctype.so
php_admin_value[extension] = curl.so
php_admin_value[extension] = dom.so
php_admin_value[extension] = fileinfo.so
php_admin_value[extension] = filter.so
php_admin_value[extension] = gd.so
php_admin_value[extension] = gettext.so
php_admin_value[extension] = hash.so
php_admin_value[extension] = iconv.so
php_admin_value[extension] = imap.so
php_admin_value[extension] = intl.so
php_admin_value[extension] = json.so
php_admin_value[extension] = mbstring.so
php_admin_value[extension] = mcrypt.so
php_admin_value[extension] = mysqli.so
php_admin_value[extension] = openssl.so
php_admin_value[extension] = pcntl.so
php_admin_value[extension] = posix.so
php_admin_value[extension] = xml.so
php_admin_value[extension] = zlib.so

php.ini (without comments):

[PHP]
engine = On
short_open_tag = Off
asp_tags = Off
precision = 14
output_buffering = 4096
zlib.output_compression = Off
implicit_flush = Off
unserialize_callback_func =
serialize_precision = 17
disable_functions =
disable_classes =
zend.enable_gc = On
expose_php = On
max_execution_time = 30
max_input_time = 60
memory_limit = 128M
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
display_errors = Off
display_startup_errors = Off
log_errors = On
log_errors_max_len = 1024
ignore_repeated_errors = Off
ignore_repeated_source = Off
report_memleaks = On
track_errors = Off
html_errors = On
variables_order = "GPCS"
request_order = "GP"
register_argc_argv = Off
auto_globals_jit = On
post_max_size = 8M
auto_prepend_file =
auto_append_file =
default_mimetype = "text/html"
default_charset = "UTF-8"
doc_root =
user_dir =
enable_dl = Off
file_uploads = On
upload_max_filesize = 2M
max_file_uploads = 20
allow_url_fopen = On
allow_url_include = Off
default_socket_timeout = 60
zend_extension=opcache.so
extension=apcu.so
[apcu]
apc.enabled = 1
apc.enable_cli = 1
[CLI Server]
cli_server.color = On
[Date]
[filter]
[iconv]
[intl]
[sqlite3]
[Pcre]
[Pdo]
[Pdo_mysql]
pdo_mysql.cache_size = 2000
pdo_mysql.default_socket=
[Phar]
[mail function]
SMTP = localhost
smtp_port = 25
mail.add_x_header = On
[SQL]
sql.safe_mode = Off
[ODBC]
odbc.allow_persistent = On
odbc.check_persistent = On
odbc.max_persistent = -1
odbc.max_links = -1
odbc.defaultlrl = 4096
odbc.defaultbinmode = 1
[Interbase]
ibase.allow_persistent = 1
ibase.max_persistent = -1
ibase.max_links = -1
ibase.timestampformat = "%Y-%m-%d %H:%M:%S"
ibase.dateformat = "%Y-%m-%d"
ibase.timeformat = "%H:%M:%S"
[MySQL]
mysql.allow_local_infile = On
mysql.allow_persistent = On
mysql.cache_size = 2000
mysql.max_persistent = -1
mysql.max_links = -1
mysql.default_port =
mysql.default_socket =
mysql.default_host =
mysql.default_user =
mysql.default_password =
mysql.connect_timeout = 60
mysql.trace_mode = Off
[MySQLi]
mysqli.max_persistent = -1
mysqli.allow_persistent = On
mysqli.max_links = -1
mysqli.cache_size = 2000
mysqli.default_port = 3306
mysqli.default_socket = /tmp/mysqlsock/mysql.sock
mysqli.default_host =
mysqli.default_user =
mysqli.default_pw =
mysqli.reconnect = Off
[mysqlnd]
mysqlnd.collect_statistics = On
mysqlnd.collect_memory_statistics = Off
[OCI8]
[PostgreSQL]
pgsql.allow_persistent = On
pgsql.auto_reset_persistent = Off
pgsql.max_persistent = -1
pgsql.max_links = -1
pgsql.ignore_notice = 0
pgsql.log_notice = 0
[Sybase-CT]
sybct.allow_persistent = On
sybct.max_persistent = -1
sybct.max_links = -1
sybct.min_server_severity = 10
sybct.min_client_severity = 10
[bcmath]
bcmath.scale = 0
[browscap]
[Session]
session.save_handler = files
session.use_strict_mode = 0
session.use_cookies = 1
session.use_only_cookies = 1
session.name = PHPSESSID
session.auto_start = 0
session.cookie_lifetime = 0
session.cookie_path = /
session.cookie_domain =
session.cookie_httponly =
session.serialize_handler = php
session.gc_probability = 1
session.gc_divisor = 1000
session.gc_maxlifetime = 1440
session.referer_check =
session.cache_limiter = nocache
session.cache_expire = 180
session.use_trans_sid = 0
session.hash_function = 0
session.hash_bits_per_character = 5
url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry"
[MSSQL]
mssql.allow_persistent = On
mssql.max_persistent = -1
mssql.max_links = -1
mssql.min_error_severity = 10
mssql.min_message_severity = 10
mssql.compatibility_mode = Off
mssql.secure_connection = Off
[Assertion]
[COM]
[mbstring]
[gd]
[exif]
[Tidy]
tidy.clean_output = Off
[soap]
soap.wsdl_cache_enabled=1
soap.wsdl_cache_dir="/tmp"
soap.wsdl_cache_ttl=86400
soap.wsdl_cache_limit = 5
[sysvshm]
[ldap]
ldap.max_links = -1
[mcrypt]
[dba]
[opcache]
opcache.enable=1
opcache.enable_cli=1
opcache.memory_consumption=128
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=4000
opcache.revalidate_freq=60
opcache.fast_shutdown=1
opcache.validate_permission=1
[curl]
[openssl]