Kilka dni temu chciałem spróbować mod_fcgid lecz natrafiłem na przeszkodę, z którą nie mogę sobie poradzić. Do rzeczy.
W przypadku zastosowania takich reguł w .htaccess (powszechnie stosowane w kohanaphp i codeigniter):
Kod: Zaznacz cały
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]
Kod: Zaznacz cały
http://mojadomena.pl/to_powinno_poleciec_do_path_info
Kod: Zaznacz cały
no input file specified
Na ten temat udało mi się znaleźć z pomocą Google, że ów komunikat pojawia się gdy PeHaP dostanie do wykonania plik, który nie istnieje.
Błąd nie występuje gdy apache pracuje jako prefork lub worker (bez fcgid).
mod_rewrite wydaje się niewinny (/var/www/vm/ to ścieżka do vhosta):
Kod: Zaznacz cały
[rid#8f05be8/initial] (3) [perdir /var/www/vm/] strip per-dir prefix: /var/www/vm/test -> test
[rid#8f05be8/initial] (3) [perdir /var/www/vm/] applying pattern '(.*)' to uri 'test'
[rid#8f05be8/initial] (4) [perdir /var/www/vm/] RewriteCond: input='/var/www/vm/test' pattern='!-f' => matched
[rid#8f05be8/initial] (4) [perdir /var/www/vm/] RewriteCond: input='/var/www/vm/test' pattern='!-d' => matched
[rid#8f05be8/initial] (2) [perdir /var/www/vm/] rewrite 'test' -> 'index.php/test'
[rid#8f05be8/initial] (3) [perdir /var/www/vm/] add per-dir prefix: index.php/test -> /var/www/vm/index.php/test
[rid#8f05be8/initial] (2) [perdir /var/www/vm/] forcing '/var/www/vm/index.php/test' to get passed through to next API URI-to-filename handler
[rid#8f05be8/initial] (2) [perdir /var/www/vm/] strip document_root prefix: /var/www/vm/index.php/test -> /index.php/test
[rid#8f05be8/initial] (1) [perdir /var/www/vm/] internal redirect with /index.php/test [INTERNAL REDIRECT]
[rid#8f1ed48/initial/redir#1] (3) [perdir /var/www/vm/] add path info postfix: /var/www/vm/index.php -> /var/www/vm/index.php/test
[rid#8f1ed48/initial/redir#1] (3) [perdir /var/www/vm/] strip per-dir prefix: /var/www/vm/index.php/test -> index.php/test
[rid#8f1ed48/initial/redir#1] (3) [perdir /var/www/vm/] applying pattern '(.*)' to uri 'index.php/test'
[rid#8f1ed48/initial/redir#1] (4) [perdir /var/www/vm/] RewriteCond: input='/var/www/vm/index.php' pattern='!-f' => not-matched
[rid#8f1ed48/initial/redir#1] (1) [perdir /var/www/vm/] pass through /var/www/vm/index.php
[rid#8efabc0/subreq] (3) [perdir /var/www/vm/] strip per-dir prefix: /var/www/vm/test -> test
[rid#8efabc0/subreq] (3) [perdir /var/www/vm/] applying pattern '(.*)' to uri 'test'
[rid#8efabc0/subreq] (4) [perdir /var/www/vm/] RewriteCond: input='/var/www/vm/test' pattern='!-f' => matched
[rid#8efabc0/subreq] (4) [perdir /var/www/vm/] RewriteCond: input='/var/www/vm/test' pattern='!-d' => matched
[rid#8efabc0/subreq] (2) [perdir /var/www/vm/] rewrite 'test' -> 'index.php/test'
[rid#8efabc0/subreq] (3) [perdir /var/www/vm/] add per-dir prefix: index.php/test -> /var/www/vm/index.php/test
[rid#8efabc0/subreq] (2) [perdir /var/www/vm/] forcing '/var/www/vm/index.php/test' to get passed through to next API URI-to-filename handler
[rid#8efabc0/subreq] (2) [perdir /var/www/vm/] strip document_root prefix: /var/www/vm/index.php/test -> /index.php/test
[rid#8efabc0/subreq] (1) [perdir /var/www/vm/] internal redirect with /index.php/test [INTERNAL REDIRECT]
Polecenie strace wykonane na procesie uruchomionym przez fcgid:
Kod: Zaznacz cały
Process 20331 attached - interrupt to quit
accept(0, {sa_family=AF_FILE, path="Q\10\31"...}, [2]) = 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\0049\0\0"..., 8) = 8
read(3, "\17\3REDIRECT_STATUS200\t\25HTTP_HOSTvm"..., 1081) = 1081
read(3, "\1\4\0\1\0\0\0\0"..., 8) = 8
getcwd("/var/www/vm"..., 4096) = 12
time(NULL) = 1303844451
lstat64("/var", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat64("/var/www", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat64("/var/www/vm", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat64("[B]/var/www/vm/redirect:[/B]", 0xbf9d109c) = -1 ENOENT (No such file or direct ory)
stat64("[B]redirect:/index.php[/B]", 0xbf9d63d8) = -1 ENOENT (No such file or directory )
stat64("redirect:", 0xbf9d63d8) = -1 ENOENT (No such file or directory)
setitimer(ITIMER_PROF, {it_interval={0, 0}, it_value={60, 0}}, NULL) = 0
rt_sigaction(SIGPROF, {0x82c22b0, [PROF], SA_RESTORER|SA_RESTART, 0xb79735f8}, { 0x82c22b0, [PROF], SA_RESTORER|SA_RESTART, 0xb79735f8}, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [PROF], NULL, 8) = 0
time(NULL) = 1303844451
write(3, "\1\6\0\1\0m\3\0Status: 404 Not Found\r\nX-"..., 120) = 120
open("/dev/urandom", O_RDONLY) = 4
read(4, "\347\200\363P"..., 4) = 4
close(4) = 0
open("/dev/urandom", O_RDONLY) = 4
read(4, "\303P\222\264"..., 4) = 4
close(4) = 0
open("/dev/urandom", O_RDONLY) = 4
read(4, "\273A\250\274"..., 4) = 4
close(4) = 0
setitimer(ITIMER_PROF, {it_interval={0, 0}, it_value={0, 0}}, NULL) = 0
write(3, "\1\3\0\1\0\10\0\0\0\0\0\0\0s: "..., 16) = 16
shutdown(3, 1 /* send */) = 0
recv(3, "\1\5\0\1\0\0\0\0"..., 8, 0) = 8
recv(3, ""..., 8, 0) = 0
close(3) = 0
accept(0, <unfinished ...>
Process 20331 detached
Chciałbym zaznaczyć, że rozwiązania dotyczące zmian w htaccess to nie rozwiązania tylko unikanie problemu.
Jeszcze garść informacji o środowisku w jakim można odtworzyć błąd: otóż prawdopodobnie jakiekolwiek. Ja próbowałem na dwóch różnych instalacjach Debiana Lenny oraz raz na Squeeze. Kolega na Windows XP. Wszystko było instalowane na czystym systemie za pomocą apt-get (w przypadku Debiana). Przy konfiguracji kierowałem się tym poradnikiem http://www.howtoforge.com/how-to-set-up ... ebian-etch
P.s. doc_root w php.ini jest puste.
Kod: Zaznacz cały
cgi.fix_pathinfo=1
Pozdrawiam.