[php-maint] Bug#888617: php7.0-fpm: php7.0 fpm causes content encoding error when parent directory with php file is in a symlink

Christopher spam-an-schnitzi at domainwg.de
Sat Jan 27 20:14:04 UTC 2018


Package: php7.0-fpm
Version: 7.0.27-0+deb9u
Severity: important

Dear Maintainer,

I was upgrading from old-stable to stable.
I was using php-fpm to serve content from several website via virtual servers.
These websites have different directories. The webserver-root is a symlinked directory linking to a different directory.

When upgrading to stretch this setup failed for some php-applications but not all producing a content encoding error.
Tested the following with recent installation of Firefox, Opera and Chrome. Client OS is an Ubuntu 17.10. Server-OS is a Debian-Stable.

Setup for diagnosis:
* Fresh install with untouched config for php7.0-fpm (except logging to syslog)
* Fresh install with untouched config for phpmyadmin - integrated via "alias" directive in apache config
* phpinfo.php file with <? php phpinfo(); ?>
* Fresh download with untouched config for extplorer - files are in webroot - no "alias" directive
--> Using standard config. Shouldn't be some wierd config issue
Looking at apache2 error, phperrorlog, fpm logs and syslog but the issue does not produce any messages or entries.

* phpmyadmin or extplorer in symlinked webroot with php7.0-fpm --> Encoding error; Content is gzipped (verified with wget --header "Accept-Encoding: gzip, deflate")
* phpinfo in symlinked webroot with php7.0-fpm --> No Encoding error; Content is gzipped
* phpmyadmin or extplorer in symlinked webroot with libapache2-mod-php7.0 --> No Encoding error
* phpmyadmin or extplorer in not-symlinked webroot with php7.0-fpm --> No Encoding error
* when using wget without --header "Accept-Encoding: gzip, deflate" --> No Encoding error

Workaround:
* In php.ini for fpm: disable_functions = ob_gzhandler
--> Might make problems for other apps or setups?

Conclusion:
My deduction is, that for some wierd reason it seems to be a problem when a php-application is capable of using the gzip function in php7.0-fpm when the path leading to the file contains a symlink somewhere along the path
Perhaps some dual compression as apache seems to compress the output as well? But wasn't able to see any difference in the compressed output using wget...

apache2-mod-deflate is installed and activated. Configuration of mods-available/deflate.conf is unchanged

Feel free to ask for more details :)

Thanks

Christopher


-- Package-specific info:
==== Additional PHP 7.0 information ====

++++ PHP 7.0 SAPI (php7.0query -S): ++++

++++ PHP 7.0 Extensions (php7.0query -M -v): ++++

++++ Configuration files: ++++
[PHP]
engine = On
short_open_tag = Off
precision = 14
output_buffering = 4096
zlib.output_compression = Off
implicit_flush = Off
unserialize_callback_func =
serialize_precision = 17
disable_functions = pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority
disable_classes =
zend.enable_gc = On
expose_php = Off
max_execution_time = 30
max_input_time = 60
memory_limit = 128M
error_reporting = E_ALL
display_errors = Off
display_startup_errors = On
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
error_log = syslog
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
[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"
[MySQLi]
mysqli.max_persistent = -1
mysqli.allow_persistent = On
mysqli.max_links = -1
mysqli.cache_size = 2000
mysqli.default_port = 3306
mysqli.default_socket =
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
[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 = 0
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"
[Assertion]
zend.assertions = -1
[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]
[curl]
[openssl]


-- System Information:
Debian Release: 9.3
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'oldstable-updates'), (500, 'stable'), (500, 'oldstable')
Architecture: x86_64

Kernel: Linux 4.9.0-5-amd64 (SMP w/2 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8), LANGUAGE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)



More information about the pkg-php-maint mailing list