Edit report at https://bugs.php.net/bug.php?id=53611&edit=1
ID: 53611 Updated by: yohg...@php.net Reported by: jraxis at gmail dot com Summary: fastcgi_param PHP_VALUE pollutes other sites -Status: Closed +Status: Re-Opened Type: Bug Package: FPM related Operating System: Linux -PHP Version: 5.3.4 +PHP Version: 5.5.0 Assigned To: fat Block user comment: N Private report: N New Comment: I think this is applicable to any versions. Updated version and re-opened. Previous Comments: ------------------------------------------------------------------------ [2013-04-03 23:29:40] steven at flechamobile dot com Hi, I can confirm the bug, I have the same issue. I have Nginx with php5-fpm as multi vhost (using sites-enabled & sites-available structure) for one of my sites I have: location ~ \.php$ { try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; include fastcgi_params; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PHP_VALUE "include_path=/path/to/includes"; fastcgi_pass 127.0.0.1:9000; } Now my other vhost website (other url) with the same conf setup but minus the fastcgi_param PHP_VALUE "include_path=/path/to/includes"; line is searching for includes at the exact same place instead of locally. I'm running Debian 6, nginx + php5-fpm + xcache (+ memcache + memcached). What files do you need for further investigation? fpm conf: ;;;;;;;;;;;;;;;;;;;;; ; FPM Configuration ; ;;;;;;;;;;;;;;;;;;;;; ; All relative paths in this configuration file are relative to PHP's install ; prefix (/usr). This prefix can be dynamicaly changed by using the ; '-p' argument from the command line. ; Include one or more files. If glob(3) exists, it is used to include a bunch of ; files from a glob(3) pattern. This directive can be used everywhere in the ; file. ; Relative path can also be used. They will be prefixed by: ; - the global prefix if it's been set (-p arguement) ; - /usr otherwise ;include=/etc/php5/fpm/*.conf ;;;;;;;;;;;;;;;;;; ; Global Options ; ;;;;;;;;;;;;;;;;;; [global] ; Pid file ; Note: the default prefix is /var ; Default Value: none pid = /var/run/php5-fpm.pid ; Error log file ; If it's set to "syslog", log is sent to syslogd instead of being written ; in a local file. ; Note: the default prefix is /var ; Default Value: log/php-fpm.log error_log = /var/log/php5-fpm.log ; syslog_facility is used to specify what type of program is logging the ; message. This lets syslogd specify that messages from different facilities ; will be handled differently. ; See syslog(3) for possible values (ex daemon equiv LOG_DAEMON) ; Default Value: daemon ;syslog.facility = daemon ; syslog_ident is prepended to every message. If you have multiple FPM ; instances running on the same server, you can change the default value ; which must suit common needs. ; Default Value: php-fpm ;syslog.ident = php-fpm ; Log level ; Possible Values: alert, error, warning, notice, debug ; Default Value: notice ;log_level = notice ; If this number of child processes exit with SIGSEGV or SIGBUS within the time ; interval set by emergency_restart_interval then FPM will restart. A value ; of '0' means 'Off'. ; Default Value: 0 emergency_restart_threshold = 10 ; Interval of time used by emergency_restart_interval to determine when ; a graceful restart will be initiated. This can be useful to work around ; accidental corruptions in an accelerator's shared memory. ; Available Units: s(econds), m(inutes), h(ours), or d(ays) ; Default Unit: seconds ; Default Value: 0 emergency_restart_interval = 1m ; Time limit for child processes to wait for a reaction on signals from master. ; Available units: s(econds), m(inutes), h(ours), or d(ays) ; Default Unit: seconds ; Default Value: 0 process_control_timeout = 10s ; The maximum number of processes FPM will fork. This has been design to control ; the global number of processes when using dynamic PM within a lot of pools. ; Use it with caution. ; Note: A value of 0 indicates no limit ; Default Value: 0 ; process.max = 128 ; Specify the nice(2) priority to apply to the master process (only if set) ; The value can vary from -19 (highest priority) to 20 (lower priority) ; Note: - It will only work if the FPM master process is launched as root ; - The pool process will inherit the master process priority ; unless it specified otherwise ; Default Value: no set ; process.priority = -19 ; Send FPM to background. Set to 'no' to keep FPM in foreground for debugging. ; Default Value: yes ;daemonize = yes ; Set open file descriptor rlimit for the master process. ; Default Value: system defined value ;rlimit_files = 1024 ; Set max core size rlimit for the master process. ; Possible Values: 'unlimited' or an integer greater or equal to 0 ; Default Value: system defined value ;rlimit_core = 0 ; Specify the event mechanism FPM will use. The following is available: ; - select (any POSIX os) ; - poll (any POSIX os) ; - epoll (linux >= 2.5.44) ; - kqueue (FreeBSD >= 4.1, OpenBSD >= 2.9, NetBSD >= 2.0) ; - /dev/poll (Solaris >= 7) ; - port (Solaris >= 10) ; Default Value: not set (auto detection) ; events.mechanism = epoll ;;;;;;;;;;;;;;;;;;;; ; Pool Definitions ; ;;;;;;;;;;;;;;;;;;;; ; Multiple pools of child processes may be started with different listening ; ports and different management options. The name of the pool will be ; used in logs and stats. There is no limitation on the number of pools which ; FPM can handle. Your system will tell you anyway :) ; To configure the pools it is recommended to have one .conf file per ; pool in the following directory: include=/etc/php5/fpm/pool.d/*.conf ------------------------------------------------------------------------ [2011-01-04 20:30:21] f...@php.net Not enough information was provided for us to be able to handle this bug. Please re-read the instructions at http://bugs.php.net/how-to-report.php If you can provide more information, feel free to add it to this bug and change the status back to "Open". Thank you for your interest in PHP. Can you please post your FPM conf ? ------------------------------------------------------------------------ [2010-12-26 00:37:17] jraxis at gmail dot com Description: ------------ In nginx+FPM, if I set a PHP_VALUE using fastcgi_param in one server, sometimes other virtual hosts are seeing those settings. An nginx.conf fragment like this:--- server { server_name foo.example; root /srv/www/foo.example; ... location ~ \.php$ { ... # usual PHP stuff } } server { server_name bar.example; root /srv/www/bar.example; ... location ~ \.php$ { ... fastcgi_param PHP_VALUE "auto_prepend_file=\"/etc/nginx/bar.php\"" } } ---will occasionally result in foo.example's pages having bar.php prepended to it. The php-fpm processes are most likely retaining the PHP_VALUE settings as they are re-used by nginx for requests for other virtual hosts. This is with PHP/5.3.4 and nginx/0.8.53 on a Gentoo Linux box. ./configure line:--- './configure' '--prefix=/usr' '--build=i686-pc-linux-gnu' '--host=i686-pc-linux-gnu' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--datadir=/usr/share' '--sysconfdir=/etc' '--localstatedir=/var/lib' '--prefix=/usr/lib/php5.3' '--mandir=/usr/lib/php5.3/man' '--infodir=/usr/lib/php5.3/info' '--libdir=/usr/lib/php5.3/lib' '--with-libdir=lib' '--without-pear' '--disable-maintainer-zts' '--enable-bcmath=shared' '--with-bz2=shared' '--enable-calendar=shared' '--with-curl=shared' '--with-curlwrappers' '--without-enchant' '--enable-exif=shared' '--enable-ftp=shared' '--with-gettext=shared' '--with-gmp=shared' '--disable-intl' '--without-kerberos' '--enable-mbstring=shared' '--with-mcrypt=shared' '--without-mssql' '--with-onig=/usr' '--with-openssl' '--with-openssl-dir=/usr' '--enable-pcntl=shared' '--without-pgsql' '--without-pspell' '--without-recode' '--enable-shmop' '--with-snmp=shared' '--enable-soap=shared' '--enable-sockets=shared' '--without-sybase-ct' '--enable-sysvmsg=shared' '--enable-sysvsem=shared' '--enable-sysvshm=shared' '--with-tidy=shared' '--enable-wddx=shared' '--with-xmlrpc=shared' '--with-xsl=shared' '--enable-zip=shared' '--with-zlib=shared' '--disable-debug' '--enable-dba=shared' '--without-cdb' '--with-db4' '--enable-flatfile' '--with-gdbm' '--enable-inifile' '--without-qdbm' '--with-freetype-dir=/usr' '--with-t1lib=/usr' '--enable-gd-jis-conv' '--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--with-xpm-dir=/usr' '--with-gd' '--with-imap=shared' '--with-imap-ssl' '--without-interbase' '--with-ldap=shared' '--with-ldap-sasl' '--with-mysql=shared,/usr' '--with-mysql-sock=/var/run/mysqld/mysqld.sock' '--with-mysqli=shared,/usr/bin/mysql_config' '--with-unixODBC=shared,/usr' '--without-adabas' '--without-birdstep' '--without-dbmaker' '--without-empress' '--without-esoob' '--without-ibm-db2' '--without-sapdb' '--without-solid' '--without-oci8' '--without-pdo-dblib' '--with-pdo-mysql=shared,/usr' '--without-pdo-pgsql' '--with-pdo-sqlite=shared,/usr' '--with-pdo-odbc=shared,unixODBC,/usr' '--with-readline' '--without-libedit' '--with-mm' '--with-sqlite=/usr' '--enable-sqlite-utf8' '--with-pcre-regex=/usr' '--with-pcre-dir=/usr' '--with-config-file-path=/etc/php/fpm-php5.3' '--with-config-file-scan-dir=/etc/php/fpm-php5.3/ext-active' '--disable-cli' '--disable-cgi' '--enable-fpm' '--disable-embed' '--without-apxs2' Test script: --------------- # /srv/www/foo.example/index.php <?php print "Foo index"; ?> # /srv/www/bar.example/index.php <?php print "Bar index"; ?> # /etc/nginx/bar.php <?php print "Bar prepend<br/>"; ?> Expected result: ---------------- # foo.example Foo index # bar.example Bar prepend Bar index Actual result: -------------- # foo.example Bar prepend Foo index # bar.example Bar prepend Bar index ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=53611&edit=1