Hi,
I’m having a problem with WWW function with a localhost url.
WWW www = new WWW(url);
yield return www;
if (!string.IsNullOrEmpty(www.error)) Debug.Log("Error : " + www.text);
else{
Debug.Log("OK : " + www.text);
}
I’m trying to call the exact same php file on localhost and on my ftp :
-Local host return an empty www.text and www.error = “ERROR” (no more info)
-On my online FTP, everything is working properly.
Do i need to setup something specific for locahost usage? When i call my localhost url from my webbrowser, it’s working too.
Thanks
I’m still trying to fix that issue, i really don’t know what’s the problem there.
Haven’t you made a mistake in your script?
You are printing www.text instead of www.error. Better print both.
Also, can you paste the url that you use? Maybe there is something wrong with it.
Hi Aurimas-Cernius
www.error => “ERROR”
I just changed to www.text to see what was the value of www.text, which is empty.
Localhost url : “http://localhost:8888/v0/getbalance.php?cur=123”
Online url : “http://45.xx.xxx.xx/unity/v0/getbalance.php?cur=123”
Also, the www.error instantly after the yield return www;
If i copy/paste the localhost url into google chrome, i do have a correct result.
Which Unity version are you using?
Does error happen in editor or some specific platform?
I’m using Unity 5.6.4p4 (MAC 10.12.6)
The problem is happening on unity Editor and on a MAC build.