I want to configure jetty to run PHP files, but have not been successful so far. I have Jetty WTP tools installed in my Eclipse IDE.
When I start the Jetty server. I got an exception: java.lang.ClassNotFoundException org.mortbay.servlet.CGI: org.mortbay.servlet.CGI and javax.servlet.UnavailableException: org.mortbay.servlet.CGI . I put a simple php file (index.php) in my WebContent folder. I also downloaded this library and added it to the class path (Eclipse: build path and add an external jar). Now I do not know what I did wrong. I also compiled php with:
./configure --with-fastcgi=/usr/local
make
sudo make install
And my web.xml file looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<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">
<display-name>Sample PHP Application</display-name>
<servlet>
<servlet-name>PHP</servlet-name>
<servlet-class>org.mortbay.servlet.CGI</servlet-class>
<init-param>
<param-name>commandPrefix</param-name>
<param-value>/usr/local/bin/php-cgi-fix</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>PHP</servlet-name>
<url-pattern>/index.php/*</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.php</welcome-file>
</welcome-file-list>
</web-app>
php-cgi-fix, :
$ /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
/usr/local/php -cgi? , , ecxeptions, .
( maven!)