Resolve "PHP not found" of PHP/Java Bridge on Gentoo Linux

Environment:
  • Gentoo Linux
  • dev-lang/php-5.3.8 +cgi
  • www-apache/mod_fastcgi-2.4.7_pre0910052141
  • www-servers/tomcat-6.0.32-r1

PHP/Java Bridge: 6.2.1, installed in /var/lib/tomcat-6/webapps/JavaBridge

Problem Description:
Follow the installation guide on the PHP/Java Bridge website.  The test by the following command does not report any error.
java -classpath JavaBridge.war TestInstallation
However, when visiting the URL http://localhost:8080/JavaBridge, an error message is returned:
java.io.IOException: PHP not found. Please install php-cgi.
PHP test command was: [/usr/bin/php-cgi, -v]

Resolution:
  1. Edit /var/lib/tomcat-6/webapps/JavaBridge/WEB-INF/web.xml.  Uncomment the following line:
    <context-param><param-name>php_exec</param-name><param-value>php-cgi</param-value></context-param>
  2. Rename the pre-compiled php-cgi brought by JavaBridge.war.
    $ cd /var/lib/tomcat-6/webapps/JavaBridge/WEB_INF/cgi/i386-linux
    $ mv php.cgi php.cgi.pjb
  3. Create a symbolic link to /usr/bin/php-cgi. Assume the working directory is /var/lib/tomcat-6/webapps/JavaBridge/WEB_INF/cgi/i386-linux.
    $ ln -s /usr/bin/php-cgi .

It is also working to use the pre-compiled php-cgi from PHP/Java Bridge. Instead of steps 2 and 3, simply make the php-cgi executable.
$ chmod +x /var/lib/tomcat-6/webapps/JavaBridge/WEB_INF/cgi/i386-linux/php-cgi
Note that the pre-compiled php-cgi from PHP/Java Bridge is not recommended.

Release of JCBR 0.8.1

Please find this version in the earlier post JCBR: Java Chinese Book Reader. In this version, the following changes are made.
  • Fix a bug in the preference dialog that does not display the gestures correctly.
  • Fix a bug in determining the change of background color and foreground color.

Release of JCBR 0.8.0

Please find this version in the earlier post JCBR: Java Chinese Book Reader. In this version, the following changes are made.
  • Add support of Windows and Linux.
  • Display the selected book name at the bottom of the bookshelves dialog.
  • Make the font of the bookshelves dialog and the TOC dialog customizable.
  • Allow language switching on Windows and Linux.

Release of JCBR 0.7.0

Please find this version in the earlier post JCBR: Java Chinese Book Reader. In this version, the following changes are made.
  • Add gestures.

Coventive (銘威國際企業股份有限公司) ..........

I WILL NEVER BUY ANY PRODUCT FROM COVENTIVE (銘威國際企業股份有限公司) AGAIN!

Customer Service: X
Product: X
Technical Support: X

-- Added 2011/04/12 --

FreeNAS is even better!

doctor - an automatic doctor scheduler

ABOUT THIS TOOL

This is an automatic doctor scheduling tool. This tool is mainly written for my wife. Hence, the basic assumptions and request types are tailored for the hospital where my wife is working.

In this tool, a hospital has branches, places, and doctors. Usually, doctors may need to be on duty in different branches on different dates. A place is a unit that belongs to some branch and needs a doctor on duty everyday. A slot is a pair of a date and a place, which is a basic unit that may require one doctor on duty. A slot is open if it really requires exactly one doctor on duty. A doctor may make requests for duty days. For example, the doctor may request for no duty days on some dates or in some branches.

All the configurations of the hospital and the schedule can be specified in a plain text file. With the configuration file as an input, this tool will try to find a satisfiable assignment. Usually not all the doctors' requests can be satisfied. It is the user's talent to adjust the requests to find a satisfiable assignment. In this tool, two real examples are included.

Release of JCBR 0.6.0

Please find this version in the earlier post JCBR: Java Chinese Book Reader. In this version, the following changes are made.
  • Add Chinese interface.