downloads | documentation | faq | getting help | mailing lists | reporting bugs | sites | links | my 
search for in the  
view the version of this page
Last updated: Thu, 21 Aug 2003

CX. XML-RPC functions


These functions can be used to write XML-RPC servers and clients. You can find more information about XML-RPC at, and more documentation on this extension and it's functions at


This extension is EXPERIMENTAL. The behaviour of this extension -- including the names of its functions and anything else documented about this extension -- may change without notice in a future release of PHP. Use this extension at your own risk.


No external libraries are needed to build this extension.


XML-RPC support in PHP is not enabled by default. You will need to use the --with-xmlrpc[=DIR] configuration option when compiling PHP to enable XML-RPC support. This extension is bundled into PHP as of 4.1.0.

Runtime Configuration

The behaviour of these functions is affected by settings in php.ini.

Table 1. XML-RPC configuration options

For further details and definition of the PHP_INI_* constants see ini_set().

Resource Types

This extension has no resource types defined.

Predefined Constants

This extension has no constants defined.

Table of Contents
xmlrpc_decode_request -- Decodes XML into native PHP types
xmlrpc_decode -- Decodes XML into native PHP types
xmlrpc_encode_request -- Generates XML for a method request
xmlrpc_encode -- Generates XML for a PHP value
xmlrpc_get_type -- Gets xmlrpc type for a PHP value. Especially useful for base64 and datetime strings
xmlrpc_parse_method_descriptions -- Decodes XML into a list of method descriptions
xmlrpc_server_add_introspection_data -- Adds introspection documentation
xmlrpc_server_call_method -- Parses XML requests and call methods
xmlrpc_server_create -- Creates an xmlrpc server
xmlrpc_server_destroy -- Destroys server resources
xmlrpc_server_register_introspection_callback -- Register a PHP function to generate documentation
xmlrpc_server_register_method -- Register a PHP function to resource method matching method_name
xmlrpc_set_type -- Sets xmlrpc type, base64 or datetime, for a PHP string value

add a note add a note User Contributed Notes
XML-RPC functions
sjtirtha at gmx dot de
22-Aug-2003 12:23
To install xml-rpc feature on Windows, you need to have "php_xmlrpc.dll" on your "/extensions" Folder.
And you need to enable it on "php.ini".

You need also library from .
to make your code simply.

Look the examples at .
mistcat attyatatat phreaker dootttt net
18-Apr-2003 05:52
Hope this saves somone some frustration:
As of php 4.3.1 and xmlrpc-epi-php-0.51 php would return a content type text/html instead of text/xml in its responses.  this is a bad thing.  Perl's XMLRPC::Lite for instance will not like you if you do this.  Happily the solution is simple:

header("Content-Type: text/xml");

Happy Hunting.

25-Mar-2003 09:21
If you need a tutorial on the XML-RPC-Extension go to devshed:
bmichael at goldparrot dot com
09-Feb-2003 01:52
If anyone is interested in making XMLRPC requests directly from the client, I have been able to get xmlrpc to
work with vcXMLRPC javascript backend.

After about 1 week of scanning the market, I found this solution to be the best on Javascript back end.  It uses the Microsoft.HTTP activeX control for IE, or HTTPRequest Object for Mozilla.

You include vc(Virtual Cowboys) vcXMLRPC.js file into your pages and make the rpc calls from with javascript to create the requests.

It works both ways.

Two Notes:

I have tested it on IE 6.02 and you need to change lines in ProcessRequest :
function to read:

  dom = this.getObject("XMLDOM",http.responseText);

and change the getObject function to use the latest ActiveX Control:

 MSXML2.XMLHTTP.3.0  (or 4.0)
 MSXML2.DOMDocument.3.0  (or 4.0)

The controls are found on MSDN in the Web Services -> XML area.

As another note, you DO NOT NEED the rpcproxy.cgi script to use this.  That is a proxy script to get around JS Security.  You can use PHP to build the proxy.  But, I was able to get the CGI working with GCC compiler on Solaris (change the -KPCI, depend and -x03 optimizer settings in the Makefile )
roland at php dot net
29-Jan-2003 06:15
You can find a good howto about the xml-rpc extension at

It's an easy client / server example - works quite good :-)
nospam at phppatterns dot com
07-Dec-2002 09:45
Note that you do need the iconv module installed to use the XML-RPC extension (see:
hfuecks at pinkgoblin dot com
26-Sep-2002 08:34
You can pass PHP errors with the XML-RPC extension as described here:
steve at orangeNOSPAMimagineering dot com
25-Aug-2002 03:32
There's a handy library by Keith Devens (version 2.2.1) at

Here is a sample client. It remotely calls sample.sumAndDifference
with two parameters (3 and 5).
It returns:

sum => 8
difference => -2

include ("kd_xmlrpc.php");
// define("XMLRPC_DEBUG", 0);    // Set to 1 for handy debugging

$method "sample.sumAndDifference";
$params XMLRPC_prepare(array(3,5));

$site "";
$location "/api/sample.php";

$success$result) = XMLRPC_request$site$location$method$params );

// XMLRPC_debug_print();    // uncomment for debugging

foreach ( $result as $key => $value ) {
" $key => $value \n");

hfuecks at pinkgoblin dot com
15-Aug-2002 10:32
This extension does not handle the process of making making XML-RPC client requests via HTTP; it only prepares the XML-RPC request payload.

This differs from many other XML-RPC implementations but offers greater flexibility, allowing SSL connections, authentication headers and XML-RPC via other transports like SMTP.
hfuecks at pinkgoblin dot com
29-Jul-2002 03:33
Anyone interested in PHP-GTK talking to an XML-RPC server:
ivanr at webkreator dot com
22-Jun-2002 01:50
For a really easy way to use this XML-RPC extension take a look at

XML-RPC Class Server (

It automatically creates servers out of PHP classes. Creating clients is almost as easy, especially with the recent addition of the overload extension to PHP (see
nic at uklinux dot NOSPAM dot net
24-Apr-2002 11:05
An alternative XML-RPC implementation is available at - it's written in PHP so you can use it on servers for which you don't have the luxury of rebuilding PHP on.

cmv at php dot net
08-Jan-2002 09:26
"Latest releases" is a bit redundant, since this extension is bundled into PHP (as of 4.1.0).  You don't need to download anything from sourceforge to make this work.  Just compile PHP with the --with-xmlrpc flag.

The site is useful, however, for documentation.
ravan_n at hotmail dot com
27-Dec-2001 07:01
Refer to the below link for documentation / latest releases of the package.

 Last updated: Thu, 21 Aug 2003
show source | credits | sitemap | mirror sites 
Copyright © 2001-2003 The PHP Group
All rights reserved.
This mirror generously provided by:
Last updated: Sat 01 Nov 2003 04:13:36 EST EST