title: jetty server run php code
body: <p>I want to configure so that jetty runs PHP files, but have been unsuccessful so far. I have Jetty WTP tools installed in my Eclipse IDE.</p>
  
  <p>When I start up the Jetty server. I got the exception: <strong>java.lang.ClassNotFoundException org.mortbay.servlet.CGI: org.mortbay.servlet.CGI</strong> and <strong>javax.servlet.UnavailableException: org.mortbay.servlet.CGI</strong>. I put a simple php file(index.php) under my WebContent folder. I also downloaded this <a href="http://www.java2s.com/Code/Jar/JKL/Downloadorgmortbayjettyjar.htm" rel="nofollow">library</a> and added it to the classpath(Eclipse: build path and add external jar). I have no clue now what I've done wrong. I also compiled php with:</p>
  
  <pre><code>./configure --with-fastcgi=/usr/local
  make
  sudo make install
  </code></pre>
  
  <p>And my web.xml file looks like this:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"&gt;
      &lt;display-name&gt;Sample PHP Application&lt;/display-name&gt;
      &lt;servlet&gt;
          &lt;servlet-name&gt;PHP&lt;/servlet-name&gt;  
          &lt;servlet-class&gt;org.mortbay.servlet.CGI&lt;/servlet-class&gt;
          &lt;init-param&gt;
              &lt;param-name&gt;commandPrefix&lt;/param-name&gt;
              &lt;param-value&gt;/usr/local/bin/php-cgi-fix&lt;/param-value&gt;
          &lt;/init-param&gt;
      &lt;/servlet&gt;
  
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;PHP&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/index.php/*&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  
      &lt;welcome-file-list&gt;
          &lt;welcome-file&gt;index.php&lt;/welcome-file&gt;
      &lt;/welcome-file-list&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p>It could be my php-cgi-fix file, I got the followig text i terminal when i open it:</p>
  
  <pre><code>$ /usr/local/bin/php-cgi-fix ; exit;
  /usr/local/bin/php-cgi-fix: line 3: /usr/bin/php-cgi: No such file or directory
  logout
  </code></pre>
  
  <p>Shouldn't be /usr/local/php-cgi instead? Ok I tried that now, but still I got the same ecxeptions when I launch the server.</p>
  
  <p>(I really don't like to use maven too!)</p>