PHP: Does xmlrpc_encode_request() need allow_url_fopen?
How does PHP's 开发者_开发百科function xmlrpc_encode_request() work?
Does it need the value of allow_url_fopen set to true?
Well, you access external URLs with this function, so does it need this configuration? I can't test it myself at the moment, unfortunately.
Thanks in advance!
No, it does not. This function is just for marshalling the requested function name and its parameters. It builds an XML string. Therefore it does not need to retrieve external URLs itself.
So this function in itself is not particular useful. Later on you will need to send the XML-encoded RPC request over an HTTP stream. And in this step 2, you need either allow_url_fopen, the curl extension, or the pecl http functions. Most XML-RPC libraries however provide a means to transmit the RPC request in HTTP via PHPs native socket functions.
So in essence, allow_url_fopen is not required.
精彩评论