Apache/PHP无法与Tomcat JavaBridge通信


Apache / PHP Unable to communicate with Tomcat JavaBridge

我的项目使用PHP JavaBridge,我安装了WAMP、JRE 6.0和Tomcat 6.0.32我现在可以访问http://localhost:8080/成功,但当我运行我的PHP网站时,它会给我以下错误

warning: fsockopen() [function.fsockopen]: unable to connect to localhost:8080 (A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. )

有人能帮我解决这个问题吗?

编辑

忘了提一下我正在使用Windows 7

我上面的评论是一个解决方案,因此得到了这个答案,这样以后其他人就会得到它。

你能用127.0.0.1:8080代替localhost:8080吗?看看你得到了什么?

fsocketopen接受主机名,它应该是一个有效的域,在您的情况下,(通常)只要您在主机文件(C:'Windows'System 32'drivers'etc'hosts)中有localhost条目,它就可以是一个合法的域。看看你有没有类似的东西。