|
From: <php...@li...> - 2017-04-07 12:02:20
|
Sorry, but the more I think on this the more I believe the debugger is
messing you up (it is using sockets to communicate with the bridge, and
maybe the bridge don't exist anymore hence the :0 address)
In your script just before you access $_GET['a'] try
file_put_contents("myDeBug.txt", print_r($_GET, true));
and see what actually exists in the $_GET var.
Dirk wrote:
> Hello,
>
> My experience is mostly the other way around - Running PHP in
> Apache(or even from the command line) and having JavaBridge.jar
> running either standalone or in tomcat in order to allow PHP to call
> Java methods.
>
> A silly question, but why are you trying to run php in Tomcat? Are you
> directly invoking php scripts from a java servelet? and if so why are
> you accessing the php stuff from a url instead of java code that
> invokes the javabridge script class directly.
>
> I do know from experience that the built in stand alone Javabridge
> http engine started with:
> java -Dphp.java.bridge.exec_sun_vm=false -Djava.awt.headless=true
> -Dphp.java.bridge.asDaemon=true -jar JavaBridge.jar HTTP:9268
> does NOT support any of the $_REQUEST variables. They simply return
> empty variables, but they do not crash!
>
> What port is your tomcat listening on? Is it the install default of
> 8080 (so to get Tomcat you go http://tomcatserver:8080) or is it port
> 80. So does your URL look like
> http://tomcatserver_*:8080*_/index.php?a=value or is it plain
> http://tomcatserver/index.php?a=value
> There is code in FastCGIServlet.java which checks whether the port in
> the URL is standard (http = 80 or https = 443) and only includes the
> port if it is NOT 80/443. From your error message it seems that a port
> of 0 is being passed, although this might be the debugger that is
> messing you up, not the real error.
>
> Have you got a php log file set in the php.ini used? Is there not
> anything useful in that for the $_GET['a'] error?
>
>
> php...@li... wrote:
>> I have one web-server - tomcat, and PHP interpreter. I want to run PHP scripts through Tomcat. And I can do it, it's all right. My error is 'fsockopen(): unable to connect to :0 (Failed to parse address"")' I already told you about it. In PHP I describe global http values $_GET and $_POST and try to get them in different ways. My script is able to get $_POST, but it is not able to get $_GET, because Tomcat give the error, when I appeal to the server by address /index.php?a=5, and in the body of my script I call $_GET['a']. The server give the error, and I don't know what to do. I want to get $_GET['a'], аbut I get only the error.
>>
>> 05.04.2017, 16:42,"php...@li..." <php...@li...>:
>>
>>> Without knowing more detail of what you are doing ... Difficult to say.
>>>
>>> From the quote below the error is in PHPDebugger, not in any of your code.
>>>
>>> Javbridge is a bunch of different things for different people. It allows
>>> calling of Java from PHP in a couple of different setups, and it also
>>> allows Java to invoke php scripts in a servlet environment like Tomcat.
>>>
>>> What have you got /trying to get?
>>> Tomcat running an instance of JavaBridge - where you are deploying PHP
>>> apps into the Tomcat instance?
>>> Tomcat running an instance of JavaBridge - and a separate Apache / Web
>>> server instance running php from which you are trying to call java?
>>> Stand alone JavaBridge servlet instance running - and a separate Apache
>>> / Web server instance running php from which you are trying to call java?
>>>
>>> php...@li... wrote:
>>>
>>>> Hello,I faced with a problem of execution Php scripts. I may not give arguments to them through address bar (like localhost/index.php?what=that), because if I do it the server returns to me the next error 'HTTP Status 500 - java.lang.RuntimeException: PHP Warning: fsockopen(): unable to connect to :0 (Failed to parse address"") in C:\Users\Eugene\Ubiquiti UniFi\webapps\ROOT\java\PHPDebugger.php on line 845'.How I can repare it? Thanks for your attantion!
>>>>
>>>> --
>>>> С Ув. Qia
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Check out the vibrant tech community on one of the world's most
>>>> engaging tech sites, Slashdot.org!http://sdm.link/slashdot
>>>> _______________________________________________
>>>> php-java-bridge-users mailing list
>>>> php...@li...
>>>> https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users
>>>>
>>> ------------------------------------------------------------------------------
>>> Check out the vibrant tech community on one of the world's most
>>> engaging tech sites, Slashdot.org!http://sdm.link/slashdot
>>> _______________________________________________
>>> php-java-bridge-users mailing list
>>> php...@li...
>>> https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users
>>>
>>
>> --
>> С Ув. Qia
>>
>> ------------------------------------------------------------------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, Slashdot.org!http://sdm.link/slashdot
>> _______________________________________________
>> php-java-bridge-users mailing list
>> php...@li...
>> https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users
>>
|