Thursday, June 25, 2009

PhpXmlRpc localhost problem

Found a problem using PhpXmlRpc library today:

Running XAMPP on Windows Vista machine, PHP ver 5.

I have an XML-RPC service running on my localhost.  I can access the service php page via browser.

Both my XML-RPC client and server resides on “localhost”.

However, when I create the XML-RPC client using “localhost” as the server address, the client can’t connect to the server. 

$client = new xmlrpc_client("/hs/service/users.php", "localhost", 80);

After replacing the “localhost” with “127.0.0.1”, the client works fine.

$client = new xmlrpc_client("/hs/service/users.php", "127.0.0.1", 80);

I’m still not sure what causes the issue.  Just take a note here for future references.