配置OpenGeo的Jetty来运行php脚本

时间:2013-05-16 10:59:45

标签: php windows jetty

我在Windows上使用OpenGeo包来开发一个带有sdk套件的Web地图应用程序。我想创建一个带有php脚本的提交表单对话框,它将数据保存到数据库中。但是,问题是它没有被Jetty服务器读取'submit.php'。当我检查firefox时,响应只显示整个脚本如下所示。首先,我用echo测试返回true。创建的应用程序在端口9080上的localhost上进行调试,而实际的应用程序是localhost:8060,它承载了Opengeo。

我也尝试过使用Php / Java桥,但它仍然是一样的。它适用于端口8060 / JavaBridge /的本地主机,并显示示例。如果你能建议一种在Opengeo包中使用php配置Jetty的方法,我将非常感激。

干杯, Zar Chi

1 个答案:

答案 0 :(得分:0)

我们最终通过使用Ubuntu 12.04LTS解决了这个问题,我们希望分享该解决方案,以防其他人使用。

1-我们按照以下流程安装了opengeo:link://suite.opengeo.org/docs/latest/installation/ubuntu/install.html

2 - 然后我们找到了这个博客:http://www.thomasknierim.com/140/java/

3-我们使用fcgi选项安装了apache,应用了这些文件中建议的配置:

a)链接:2bits.com/articles/apache-fcgid-acceptable-performance-and-better-resource-utilization.html。这些其他博客也类似,所以我继续。

b)链接:howtoforge.com/using-php5-fpm-with-apache2-on-ubuntu-12.04-lts

c)链接:versatilewebsolutions.com/blog/2012/11/installing-apache-2-with-php-fastcgi-on-ubuntu-12-10.html

4-我们按照这里的说明进行操作(链接:/php-java-bridge.sourceforge.net/pjb/download.php):

Use a graphical packet installer to install PHP. Or download JavaBridge.war, which contains an embedded PHP binary. (I suggest you try again with PHP standalone directly, NOT with JavaBridge.war file)
Download and install Java 6 or above. (/usr/lib/jvm/java-6-openjdk)
Download and install the original tomcat servlet engine. (/var/lib/tomcat6)
There must be JavaBridge.jar, php-servlet.jar and php-script.jar files in your /usr/share/tomcat6/lib
Double-check again /var/lib/tomcat6/conf/web.xml
Retart Tomcat server and check it is working now?

5-如果没有,问题可能与jar.libraries的权限有关。应该通过tomcat6访问:tomcat6。每个部署都调用这些库来自动创建一个包含Java.inc和JavaProxy.php的Java文件夹。