如何使用PHP在开放式火灾中添加用户?

I'd like to create a user in open fire in PHP using curl, please help.

<?php

    "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?
    <user>
    <username>nitin</username>
    <password>patel</password>
    </user>";
    $url = "http://111.111.111.111:5223/plugins/userService/users";
    $ch = curl_init();
    curl_setopt ($ch, CURLOPT_URL, $url);
    curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, 5);
    curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
    $contents = curl_exec($ch);
    if (curl_errno($ch)) {
    echo curl_error($ch);
    echo "
<br />";
    $contents = '';
    }
    else {
    curl_close($ch);
    }
    if (!is_string($contents) || !strlen($contents)) {
    echo "Failed to get contents.";
    $contents = '';
    }
    echo $contents;
?>

it gives output:P

Try to increase the connection timeout from 5 to 30 then try again.

Go to openfire administration and install REST API Plugin then follow the API. It allows users ang groups CRUD. You need to set the Secret key and Allowed IP Addresses in order to use the API

Check this page to see the code for the connection and also for adding the user on the server