Debian Bug report logs - #574000
php5-cgi: When php run as fcgi, it tries to read system config file 'php-cgi-fcgi.ini' instead of 'php.ini'

version graph

Package: php5-cgi; Maintainer for php5-cgi is (unknown);

Reported by: Eiichiro ITANI <emu@ceres.dti.ne.jp>

Date: Mon, 15 Mar 2010 15:39:14 UTC

Severity: important

Tags: moreinfo, unreproducible

Found in version php5/5.3.2-1

Done: Ondřej Surý <ondrej@sury.org>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>:
Bug#574000; Package php5-cgi. (Mon, 15 Mar 2010 15:39:17 GMT) (full text, mbox, link).


Acknowledgement sent to Eiichiro ITANI <emu@ceres.dti.ne.jp>:
New Bug report received and forwarded. Copy sent to Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>. (Mon, 15 Mar 2010 15:39:17 GMT) (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Eiichiro ITANI <emu@ceres.dti.ne.jp>
To: submit@bugs.debian.org
Subject: php5-cgi: When php run as fcgi, it tries to read system config file 'php-cgi-fcgi.ini' instead of 'php.ini'
Date: Tue, 16 Mar 2010 00:38:13 +0900
Subject: php5-cgi: When php run as fcgi, it tries to read system config file 'php-cgi-fcgi.ini' instead of 'php.ini'
Package: php5-cgi
Version: 5.3.2-1
Justification: renders package unusable
Severity: grave

*** Please type your report below this line ***

After upgraded php5-cgi to 5.3.2-1, my local web server's php scripts
stop running, with message 'No input file specified.'

I replaced my php binary instance in fcgi script directory as:

#!/bin/sh
exec strace ./php5.real $* 2>> /tmp/php5.strace

And found strace log:

$ grep open /tmp/php5.strace
...<snip>...
open("./php-cgi-fcgi.ini", O_RDONLY)    = -1 ENOENT (No such file or directory)
open("/usr/bin/php-cgi-fcgi.ini", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/etc/php5/cgi/php-cgi-fcgi.ini", O_RDONLY) = 3
open("/etc/php5/cgi/conf.d", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 3
open("/etc/php5/cgi/conf.d/gd.ini", O_RDONLY) = 3
open("/etc/php5/cgi/conf.d/mysql.ini", O_RDONLY) = 3
open("/etc/php5/cgi/conf.d/mysqli.ini", O_RDONLY) = 3
open("/etc/php5/cgi/conf.d/pdo.ini", O_RDONLY) = 3
open("/etc/php5/cgi/conf.d/pdo_mysql.ini", O_RDONLY) = 3
open("/etc/php5/cgi/conf.d/pdo_pgsql.ini", O_RDONLY) = 3
open("/etc/php5/cgi/conf.d/pdo_sqlite.ini", O_RDONLY) = 3
open("/etc/php5/cgi/conf.d/pgsql.ini", O_RDONLY) = 3
open("/etc/php5/cgi/conf.d/sqlite.ini", O_RDONLY) = 3
open("/etc/php5/cgi/conf.d/sqlite3.ini", O_RDONLY) = 3
open("/etc/php5/cgi/conf.d/suhosin.ini", O_RDONLY) = 3
...<snip>...

So, I made symbolic link
# ln -s php.ini /etc/php5/cgi/php-cgi-fcgi.ini

Now my php pages are running correctly as before.

I believe that must be some compile time configuration mistake,
or it should be documented in README.Upgrading, or something.


-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable'), (20, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-trunk-amd64 (SMP w/2 CPU cores)
Locale: LANG=ja_JP.eucJP, LC_CTYPE=ja_JP.eucJP (charmap=EUC-JP)
Shell: /bin/sh linked to /bin/bash

Versions of packages php5-cgi depends on:
ii  libbz2-1.0             1.0.5-4           high-quality block-sorting file co
ii  libc6                  2.10.2-6          Embedded GNU C Library: Shared lib
ii  libcomerr2             1.41.10-1         common error description library
ii  libdb4.8               4.8.26-1          Berkeley v4.8 Database Libraries [
ii  libgssapi-krb5-2       1.8+dfsg~alpha1-7 MIT Kerberos runtime libraries - k
ii  libk5crypto3           1.8+dfsg~alpha1-7 MIT Kerberos runtime libraries - C
ii  libkrb5-3              1.8+dfsg~alpha1-7 MIT Kerberos runtime libraries
ii  libmagic1              5.04-1            File type determination library us
ii  libonig2               5.9.1-1           Oniguruma regular expressions libr
ii  libpcre3               7.8-3             Perl 5 Compatible Regular Expressi
ii  libqdbm14              1.8.77-custom1    QDBM Database Libraries [runtime]
ii  libssl0.9.8            0.9.8m-2          SSL shared libraries
ii  libxml2                2.7.6.dfsg-2+b1   GNOME XML library
ii  mime-support           3.48-1            MIME files 'mime.types' & 'mailcap
ii  php5-common            5.3.2-1           Common files for packages built fr
ii  tzdata                 2010e-1           time zone and daylight-saving time
ii  ucf                    3.0025            Update Configuration File: preserv
ii  zlib1g                 1:1.2.3.4.dfsg-3  compression library - runtime

php5-cgi recommends no packages.

Versions of packages php5-cgi suggests:
ii  php-pear                      5.3.2-1    PEAR - PHP Extension and Applicati

-- no debconf information




Information forwarded to debian-bugs-dist@lists.debian.org, Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>:
Bug#574000; Package php5-cgi. (Mon, 15 Mar 2010 22:15:06 GMT) (full text, mbox, link).


Acknowledgement sent to Ondřej Surý <ondrej@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>. (Mon, 15 Mar 2010 22:15:06 GMT) (full text, mbox, link).


Message #10 received at 574000@bugs.debian.org (full text, mbox, reply):

From: Ondřej Surý <ondrej@debian.org>
To: Eiichiro ITANI <emu@ceres.dti.ne.jp>, 574000@bugs.debian.org
Subject: Re: [php-maint] Bug#574000: php5-cgi: When php run as fcgi, it tries to read system config file 'php-cgi-fcgi.ini' instead of 'php.ini'
Date: Mon, 15 Mar 2010 23:13:38 +0100
tags 574000 +moreinfo unreproducible
severity 574000 important
thank you

> After upgraded php5-cgi to 5.3.2-1, my local web server's php scripts
> stop running, with message 'No input file specified.'
>
> I replaced my php binary instance in fcgi script directory as:
>
> #!/bin/sh
> exec strace ./php5.real $* 2>> /tmp/php5.strace

The strace you send is after you already made symbolic link.

strace under clean system looks like this:

open("./php-cgi-fcgi.ini", O_RDONLY)    = -1 ENOENT (No such file or directory)
open("/usr/bin/php-cgi-fcgi.ini", O_RDONLY) = -1 ENOENT (No such file
or directory)
open("/etc/php5/cgi/php-cgi-fcgi.ini", O_RDONLY) = -1 ENOENT (No such
file or directory)
open("./php.ini", O_RDONLY)             = -1 ENOENT (No such file or directory)
open("/usr/bin/php.ini", O_RDONLY)      = -1 ENOENT (No such file or directory)
open("/etc/php5/cgi/php.ini", O_RDONLY) = 3
lstat("/etc/php5/cgi/php.ini", {st_mode=S_IFREG|0644, st_size=67459, ...}) = 0
lstat("/etc/php5/cgi", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat("/etc/php5", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat("/etc", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0


I believe there is something hidden inside this script. Could you
provide more info on your fcgi configuration?

-- 
Ondřej Surý <ondrej@sury.org>
http://blog.rfc1925.org/




Added tag(s) unreproducible and moreinfo. Request was from Ondřej Surý <ondrej@debian.org> to control@bugs.debian.org. (Mon, 15 Mar 2010 22:15:08 GMT) (full text, mbox, link).


Severity set to 'important' from 'grave' Request was from Ondřej Surý <ondrej@debian.org> to control@bugs.debian.org. (Mon, 15 Mar 2010 22:15:08 GMT) (full text, mbox, link).


Information forwarded to debian-bugs-dist@lists.debian.org, Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>:
Bug#574000; Package php5-cgi. (Tue, 16 Mar 2010 04:21:03 GMT) (full text, mbox, link).


Acknowledgement sent to Eiichiro ITANI <emu@ceres.dti.ne.jp>:
Extra info received and forwarded to list. Copy sent to Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>. (Tue, 16 Mar 2010 04:21:03 GMT) (full text, mbox, link).


Message #19 received at 574000@bugs.debian.org (full text, mbox, reply):

From: Eiichiro ITANI <emu@ceres.dti.ne.jp>
To: Ondřej Surý <ondrej@debian.org>
Cc: 574000@bugs.debian.org
Subject: Re: [php-maint] Bug#574000: php5-cgi: When php run as fcgi, it tries to read system config file 'php-cgi-fcgi.ini' instead of 'php.ini'
Date: Tue, 16 Mar 2010 13:09:04 +0900
Ondřej Surý <ondrej@debian.org> writes:

> strace under clean system looks like this:
>
> open("./php-cgi-fcgi.ini", O_RDONLY)    = -1 ENOENT (No such file or directory)
> open("/usr/bin/php-cgi-fcgi.ini", O_RDONLY) = -1 ENOENT (No such file
> or directory)
> open("/etc/php5/cgi/php-cgi-fcgi.ini", O_RDONLY) = -1 ENOENT (No such
> file or directory)
> open("./php.ini", O_RDONLY)             = -1 ENOENT (No such file or directory)
> open("/usr/bin/php.ini", O_RDONLY)      = -1 ENOENT (No such file or directory)
> open("/etc/php5/cgi/php.ini", O_RDONLY) = 3
> lstat("/etc/php5/cgi/php.ini", {st_mode=S_IFREG|0644, st_size=67459, ...}) = 0
> lstat("/etc/php5/cgi", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
> lstat("/etc/php5", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
> lstat("/etc", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0

> I believe there is something hidden inside this script. Could you
> provide more info on your fcgi configuration?

Oops, I'm very sorry.  I have put small php.ini in fcgi-script
directory, to override system default.  After I removed './php.ini'
file, strace output become exactly same as above, and no more 'no input
file specified' error.

But before upgrading, fcgi php5 was working with no problems even when
'./php.ini' could be read.  After upgrade, php5 stop seeking for php.ini
once it finds one in current directory.

Is that wrong to put php.ini in script dircetory?  If so, could you
close this bug, please.

Anyway, now this is strace of php5.

$ ls -l /etc/php5/cgi/*.ini
-rw-r--r-- 1 root root 69333 2010-03-15 21:51 /etc/php5/cgi/php.ini

$ ls -l fcgi-bin/
-rw-rw-r-- 1 user group   70 2010-03-15 21:29 php.ini
lrwxrwxrwx 1 user group   19 2010-03-16 12:45 php5 -> php5.strace_wrapper*
lrwxrwxrwx 1 user group   17 2009-02-19 19:42 php5.real -> /usr/bin/php5-cgi*
-rwxrwxr-x 1 user group   58 2010-03-15 22:04 php5.strace_wrapper*

$ cat fcgi-bin/php5.strace_wrapper 
#!/bin/sh
exec strace ./php5.real $* 2>> /tmp/php5.strace

$ grep open /tmp/php5.strace
...<snip>...
open("./php-cgi-fcgi.ini", O_RDONLY)    = -1 ENOENT (No such file or directory)
open("/usr/bin/php-cgi-fcgi.ini", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/etc/php5/cgi/php-cgi-fcgi.ini", O_RDONLY) = -1 ENOENT (No such file or directory)
open("./php.ini", O_RDONLY)             = 3
open("/etc/php5/cgi/conf.d", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 3
open("/etc/php5/cgi/conf.d/gd.ini", O_RDONLY) = 3
open("/etc/php5/cgi/conf.d/mysql.ini", O_RDONLY) = 3
open("/etc/php5/cgi/conf.d/mysqli.ini", O_RDONLY) = 3
open("/etc/php5/cgi/conf.d/pdo.ini", O_RDONLY) = 3
open("/etc/php5/cgi/conf.d/pdo_mysql.ini", O_RDONLY) = 3
open("/etc/php5/cgi/conf.d/pdo_pgsql.ini", O_RDONLY) = 3
open("/etc/php5/cgi/conf.d/pdo_sqlite.ini", O_RDONLY) = 3
open("/etc/php5/cgi/conf.d/pgsql.ini", O_RDONLY) = 3
open("/etc/php5/cgi/conf.d/sqlite.ini", O_RDONLY) = 3
open("/etc/php5/cgi/conf.d/sqlite3.ini", O_RDONLY) = 3
open("/etc/php5/cgi/conf.d/suhosin.ini", O_RDONLY) = 3
open("/usr/lib/php5/20090626/gd.so", O_RDONLY) = 3
...<snip>...




Reply sent to Ondřej Surý <ondrej@sury.org>:
You have taken responsibility. (Tue, 16 Mar 2010 07:21:04 GMT) (full text, mbox, link).


Notification sent to Eiichiro ITANI <emu@ceres.dti.ne.jp>:
Bug acknowledged by developer. (Tue, 16 Mar 2010 07:21:04 GMT) (full text, mbox, link).


Message #24 received at 574000-done@bugs.debian.org (full text, mbox, reply):

From: Ondřej Surý <ondrej@sury.org>
To: "574000-done@bugs.debian.org" <574000-done@bugs.debian.org>
Subject: Fwd: [php-maint] Bug#574000: Bug#574000: php5-cgi: When php run as fcgi, it tries to read system config file 'php-cgi-fcgi.ini' instead of 'php.ini'
Date: Tue, 16 Mar 2010 08:18:41 +0100
[Message part 1 (text/plain, inline)]
Closing the bug as per requestor wish.

Ondrej Sury

Begin forwarded message:

> Resent-From: Eiichiro ITANI <emu@ceres.dti.ne.jp>
> From: Eiichiro ITANI <emu@ceres.dti.ne.jp>
> Date: 16. března 2010 05:09:04 GMT+01:00
> Resent-To: debian-bugs-dist@lists.debian.org
> To: Ond$@rietz.debian.org(D+Z(Bej Sur$(D+r(B <ondrej@debian.org>
> Resent-Cc: Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org 
> >
> Cc: 574000@bugs.debian.org
> Subject: [php-maint] Bug#574000: Bug#574000: php5-cgi: When php run  
> as fcgi, it tries to read system config file 'php-cgi-fcgi.ini'  
> instead of 'php.ini'
> Reply-To: Eiichiro ITANI <emu@ceres.dti.ne.jp>, 574000@bugs.debian.org
>

> Ondřej Surý <ondrej@debian.org> writes:
>
>> strace under clean system looks like this:
>>
>> open("./php-cgi-fcgi.ini", O_RDONLY)    = -1 ENOENT (No such file  
>> or directory)
>> open("/usr/bin/php-cgi-fcgi.ini", O_RDONLY) = -1 ENOENT (No such file
>> or directory)
>> open("/etc/php5/cgi/php-cgi-fcgi.ini", O_RDONLY) = -1 ENOENT (No such
>> file or directory)
>> open("./php.ini", O_RDONLY)             = -1 ENOENT (No such file  
>> or directory)
>> open("/usr/bin/php.ini", O_RDONLY)      = -1 ENOENT (No such file  
>> or directory)
>> open("/etc/php5/cgi/php.ini", O_RDONLY) = 3
>> lstat("/etc/php5/cgi/php.ini", {st_mode=S_IFREG|0644,  
>> st_size=67459, ...}) = 0
>> lstat("/etc/php5/cgi", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
>> lstat("/etc/php5", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
>> lstat("/etc", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
>
>> I believe there is something hidden inside this script. Could you
>> provide more info on your fcgi configuration?
>
> Oops, I'm very sorry.  I have put small php.ini in fcgi-script
> directory, to override system default.  After I removed './php.ini'
> file, strace output become exactly same as above, and no more 'no  
> input
> file specified' error.
>
> But before upgrading, fcgi php5 was working with no problems even when
> './php.ini' could be read.  After upgrade, php5 stop seeking for  
> php.ini
> once it finds one in current directory.
>
> Is that wrong to put php.ini in script dircetory?  If so, could you
> close this bug, please.
>
> Anyway, now this is strace of php5.
>
> $ ls -l /etc/php5/cgi/*.ini
> -rw-r--r-- 1 root root 69333 2010-03-15 21:51 /etc/php5/cgi/php.ini
>
> $ ls -l fcgi-bin/
> -rw-rw-r-- 1 user group   70 2010-03-15 21:29 php.ini
> lrwxrwxrwx 1 user group   19 2010-03-16 12:45 php5 ->  
> php5.strace_wrapper*
> lrwxrwxrwx 1 user group   17 2009-02-19 19:42 php5.real -> /usr/bin/ 
> php5-cgi*
> -rwxrwxr-x 1 user group   58 2010-03-15 22:04 php5.strace_wrapper*
>
> $ cat fcgi-bin/php5.strace_wrapper
> #!/bin/sh
> exec strace ./php5.real $* 2>> /tmp/php5.strace
>
> $ grep open /tmp/php5.strace
> ...<snip>...
> open("./php-cgi-fcgi.ini", O_RDONLY)    = -1 ENOENT (No such file or  
> directory)
> open("/usr/bin/php-cgi-fcgi.ini", O_RDONLY) = -1 ENOENT (No such  
> file or directory)
> open("/etc/php5/cgi/php-cgi-fcgi.ini", O_RDONLY) = -1 ENOENT (No  
> such file or directory)
> open("./php.ini", O_RDONLY)             = 3
> open("/etc/php5/cgi/conf.d", O_RDONLY|O_NONBLOCK|O_DIRECTORY| 
> O_CLOEXEC) = 3
> open("/etc/php5/cgi/conf.d/gd.ini", O_RDONLY) = 3
> open("/etc/php5/cgi/conf.d/mysql.ini", O_RDONLY) = 3
> open("/etc/php5/cgi/conf.d/mysqli.ini", O_RDONLY) = 3
> open("/etc/php5/cgi/conf.d/pdo.ini", O_RDONLY) = 3
> open("/etc/php5/cgi/conf.d/pdo_mysql.ini", O_RDONLY) = 3
> open("/etc/php5/cgi/conf.d/pdo_pgsql.ini", O_RDONLY) = 3
> open("/etc/php5/cgi/conf.d/pdo_sqlite.ini", O_RDONLY) = 3
> open("/etc/php5/cgi/conf.d/pgsql.ini", O_RDONLY) = 3
> open("/etc/php5/cgi/conf.d/sqlite.ini", O_RDONLY) = 3
> open("/etc/php5/cgi/conf.d/sqlite3.ini", O_RDONLY) = 3
> open("/etc/php5/cgi/conf.d/suhosin.ini", O_RDONLY) = 3
> open("/usr/lib/php5/20090626/gd.so", O_RDONLY) = 3
> ...<snip>...
>
>
>
> _______________________________________________
> pkg-php-maint mailing list
> pkg-php-maint@lists.alioth.debian.org
> http://lists.alioth.debian.org/mailman/listinfo/pkg-php-maint
[Message part 2 (text/html, inline)]

Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Tue, 13 Apr 2010 07:29:28 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sun Jul 2 02:34:27 2023; Machine Name: bembo

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.