PHP on Tomcat as CGI

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tombo

    PHP on Tomcat as CGI

    Hi,
    I'm trying to get PHP running as a CGI app on Tomcat. I've managed to
    do sufficent Tomcat setup to get it to invoke the PHP interpreter,
    but all I get is the feared "No input file specified."

    Looking aroung the php site, it seems this is caused by PHP-cgi really
    wanting to be passed SCRIPT_FILENAME . Looking at the Tomcat logs, it
    seems this is not being passed. I'm investigating how to get Tomcat to
    pass this variable, but in case that dosn't work, can anyone answer
    these:
    * does SCRIPT_FILENAME cause this in other webservers?
    * if (and how) can I get php to be less hung up on seeing this
    variable?

    Thanks all,
    Tombo

    System:
    PHP 5.0.1 (cgi-fcgi) (built: Aug 12 2004 23:30:44)
    Apache Tomcat 5.0.27 Server
    Windows XP (I don't like it either, but these hands are tied)

    Config:
    I used the php.ini-dist from the package and have changed the
    following:
    * I had to set [cgi.force_redir ect = 0] to get this far.
    * I've tried changing doc_root to the directory where my php files are
    (C:\Tomcat5\web apps\ROOT\WEB-INF\cgi), without any luck.

    Env vars being passed via CGI:
    HTTP_USER_AGENT =Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
    rv:1.7) Gecko/20040626 Firefox/0.9.1
    HTTP_ACCEPT_ENC ODING=gzip,defl ate
    REQUEST_METHOD= GET
    AUTH_TYPE=
    HTTP_ACCEPT_LAN GUAGE=en-us,en;q=0.5
    SERVER_NAME=127 .0.0.1
    SERVER_SOFTWARE =TOMCAT
    HTTP_KEEP_ALIVE =300
    HTTP_ACCEPT_CHA RSET=ISO-8859-1,utf-8;q=0.7,*;q=0.7
    HTTP_HOST=127.0 .0.1
    GATEWAY_INTERFA CE=CGI/1.1
    X_TOMCAT_SCRIPT _PATH=C:\Tomcat 5\webapps\ROOT\ WEB-INF\cgi\foo.php
    REMOTE_ADDR=127 .0.0.1
    SERVER_PROTOCOL =HTTP/1.1
    HTTP_CACHE_CONT ROL=max-age=0
    PATH_INFO=
    REMOTE_HOST=127 .0.0.1
    QUERY_STRING=
    HTTP_CONNECTION =keep-alive
    SERVER_PORT=80
    CONTENT_TYPE=
    CONTENT_LENGTH=
    HTTP_ACCEPT=tex t/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,ima ge/png,*/*;q=0.5
    SCRIPT_NAME=/cgi-bin\foo.php
    REMOTE_USER=
    REMOTE_IDENT=

    command=C:\Tomc at5\webapps\ROO T\WEB-INF\cgi\foo.php
Working...