顯示具有 Gentoo 標籤的文章。 顯示所有文章
顯示具有 Gentoo 標籤的文章。 顯示所有文章

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.

Failed to Install camlp5 in Gentoo Linux - "make inconsistent assumptions over implementation Pretty"

When I use emerge to install camlp5-5.14 with ocaml-3.11.2 (or camlp5-5.12 with ocaml-3.10.2) and with ocamlopt enabled in Gentoo Linux, I get the following error message:
File "_none_", line 1, characters 0-1:
Error: Files prtools.cmx and ../lib/pretty.cmx
       make inconsistent assumptions over implementation Pretty
To solve this problem, I temporarily move /usr/lib/ocaml/pretty.cmx to some other place (or rename it). Don't forget to move the file back after camlp5 is installed successfully.

Added on 2010/11/29: I found the reason. The error message occurs because I installed the libraries of CIL in /usr/lib/ocaml by a self-written ebuild file. To prevent this error every time upgrading camlp5, I should install the CIL libraries in a separate folder.