Edit report at http://bugs.php.net/bug.php?id=54612&edit=1
ID: 54612
Comment by: erno dot kovacs at freemail dot hu
Reported by: erno dot kovacs at freemail dot hu
Summary: FPM+chroot: random Error 404
Status: Open
Type: Bug
Package: FPM related
Operating System: Linux
PHP Version: 5.3.6
Block user comment: N
Private report: N
New Comment:
Workarounds:
cgi.fix_pathinfo = 0
OR
using nginx and sending "correct" SCRIPT_FILENAME parameter
Previous Comments:
------------------------------------------------------------------------
[2011-04-27 16:37:36] erno dot kovacs at freemail dot hu
Description:
------------
Debian squeze:
# uname -a
Linux xxx 2.6.32-5-amd64 #1 SMP Mon Mar 7 21:35:22 UTC 2011 x86_64
GNU/Linux
Lighty 1.4.28 with fastcgi config lines:
fastcgi.server = ( ".php" =>
(
(
"host" => "127.0.0.1",
"port" => 9001
)
)
)
# ls -l /web/web/host/web/web/host
lrwxrwxrwx 1 root root 1 Apr 26 15:10 /web/web/host/web/web/host -> /
Docroot is:
/web/web/host/teszdomain.hu/pages
If I turn on chroot to /web/web/host in the fpm config, PHP starts
dropping error 404 randomly:
Process 26491 attached - interrupt to quit
accept(0, {sa_family=AF_INET, sin_port=htons(57968),
sin_addr=inet_addr("127.0.0.1")}, [16]) = 3
poll([{fd=3, events=POLLIN}], 1, 5000) = 1 ([{fd=3, revents=POLLIN}])
read(3, "\1\1\0\1\0\10\0\0", 8) = 8
read(3, "\0\1\0\0\0\0\0\0", 8) = 8
read(3, "\1\4\0\1\3`\0\0", 8) = 8
read(3, "\17\17SERVER_SOFTWARElighttpd/1.4.28"..., 864) = 864
read(3, "\1\4\0\1\0\0\0\0", 8) = 8
lstat("/web/web/host/tesztdomain.hu/pages/x.php", {st_mode=S_IFREG|0644,
st_size=102, ...}) = 0
lstat("/web/web/host/tesztdomain.hu/pages", {st_mode=S_IFDIR|0755,
st_size=4096, ...}) = 0
lstat("/web/web/host/tesztdomain.hu", {st_mode=S_IFDIR|0755, st_size=29,
...}) = 0
stat("/web/web/host/tesztdomain.hu/pages", {st_mode=S_IFDIR|0755,
st_size=4096, ...}) = 0
stat("/web/web/host/tesztdomain.hu", {st_mode=S_IFDIR|0755, st_size=29,
...}) = 0
stat("/web/web/host", {st_mode=S_IFDIR|0111, st_size=4096, ...}) = 0
stat("/web/web", {st_mode=S_IFDIR|0755, st_size=17, ...}) = 0
stat("/web", {st_mode=S_IFDIR|0755, st_size=16, ...}) = 0
stat("", 0x7fffc3463110) = -1 ENOENT (No such file or
directory)
setitimer(ITIMER_PROF, {it_interval={0, 0}, it_value={60, 0}}, NULL) =
0
rt_sigaction(SIGPROF, {0x664e20, [PROF], SA_RESTORER|SA_RESTART,
0x7f04f9d7e1e0}, {0x664e20, [PROF], SA_RESTORER|SA_RESTART,
0x7f04f9d7e1e0}, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [PROF], NULL, 8) = 0
write(3, "\1\6\0\1\0002\6\0Status: 404 Not Found\r\nC"..., 80) = 80
shutdown(3, 1 /* send */) = 0
recvfrom(3, "\1\5\0\1\0\0\0\0", 8, 0, NULL, NULL) = 8
recvfrom(3, "", 8, 0, NULL, NULL) = 0
close(3) = 0
setitimer(ITIMER_PROF, {it_interval={0, 0}, it_value={0, 0}}, NULL) = 0
accept(0, ^C <unfinished ...>
Process 26491 detached
And sometimes it works just fine:
Process 26491 attached - interrupt to quit
accept(0, {sa_family=AF_INET, sin_port=htons(59088),
sin_addr=inet_addr("127.0.0.1")}, [16]) = 3
poll([{fd=3, events=POLLIN}], 1, 5000) = 1 ([{fd=3, revents=POLLIN}])
read(3, "\1\1\0\1\0\10\0\0", 8) = 8
read(3, "\0\1\0\0\0\0\0\0", 8) = 8
read(3, "\1\4\0\1\3`\0\0", 8) = 8
read(3, "\17\17SERVER_SOFTWARElighttpd/1.4.28"..., 864) = 864
read(3, "\1\4\0\1\0\0\0\0", 8) = 8
lstat("/web/web/host/tesztdomain.hu/pages/x.php", {st_mode=S_IFREG|0644,
st_size=102, ...}) = 0
lstat("/web/web/host/tesztdomain.hu/pages", {st_mode=S_IFDIR|0755,
st_size=4096, ...}) = 0
lstat("/web/web/host/tesztdomain.hu", {st_mode=S_IFDIR|0755, st_size=29,
...}) = 0
lstat("/web/web/host", {st_mode=S_IFLNK|0777, st_size=1, ...}) = 0
readlink("/web/web/host", "/"..., 4096) = 1
stat("/web/web/host/tesztdomain.hu/pages/.user.ini", 0x7fffc3460aa0) =
-1 ENOENT (No such file or directory)
setitimer(ITIMER_PROF, {it_interval={0, 0}, it_value={60, 0}}, NULL) =
0
rt_sigaction(SIGPROF, {0x664e20, [PROF], SA_RESTORER|SA_RESTART,
0x7f04f9d7e1e0}, {0x664e20, [PROF], SA_RESTORER|SA_RESTART,
0x7f04f9d7e1e0}, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [PROF], NULL, 8) = 0
open("/tesztdomain.hu/pages/x.php", O_RDONLY) = 4
fstat(4, {st_mode=S_IFREG|0644, st_size=102, ...}) = 0
getcwd("/", 4095) = 2
chdir("/web/web/host/tesztdomain.hu/pages") = 0
setitimer(ITIMER_PROF, {it_interval={0, 0}, it_value={120, 0}}, NULL) =
0
ioctl(4, SNDCTL_TMR_TIMEBASE or TCGETS, 0x7fffc345e850) = -1 ENOTTY
(Inappropriate ioctl for device)
fstat(4, {st_mode=S_IFREG|0644, st_size=102, ...}) = 0
mmap(NULL, 134, PROT_READ, MAP_PRIVATE, 4, 0) = 0x7f04fd5cf000
fstat(4, {st_mode=S_IFREG|0644, st_size=102, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0)
= 0x7f04fd5ce000
lseek(4, 0, SEEK_CUR) = 0
munmap(0x7f04fd5cf000, 102) = 0
close(4) = 0
munmap(0x7f04fd5ce000, 4096) = 0
uname({sys="Linux", node="xxx", ...}) = 0
write(3, "\1\6\0\1\37\370\0\0Content-type: text/html\r"..., 8192) =
8192
write(3, "\1\6\0\1\37\370\0\0=\"v\">Off</td></tr>\n<tr><"..., 8192) =
8192
write(3, "\1\6\0\1\37\370\0\0<td class=\"e\">y2k_compli"..., 8192) =
8192
write(3, "\1\6\0\1\37\370\0\0 cellpadding=\"3\" width=\""..., 8192) =
8192
write(3, "\1\6\0\1\37\370\0\0d><td class=\"v\">100</td>"..., 8192) =
8192
chdir("/") = 0
write(3, "\1\6\0\1\30\353\5\0s=\"e\">_REQUEST[\"PHPSESSI"..., 6408) =
6408
shutdown(3, 1 /* send */) = 0
recvfrom(3, "\1\5\0\1\0\0\0\0", 8, 0, NULL, NULL) = 8
recvfrom(3, "", 8, 0, NULL, NULL) = 0
close(3) = 0
setitimer(ITIMER_PROF, {it_interval={0, 0}, it_value={0, 0}}, NULL) = 0
accept(0, ^C <unfinished ...>
Note, I run PHP-FPM with the same chroot+symlink trick on other box and
it works fine all the time.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=54612&edit=1