# Wowza Streaming Curl command code translation to the PHP

**URL:** <https://community.wowza.com/t/wowza-streaming-curl-command-code-translation-to-the-php/47176>\
**Category:** Wowza Streaming Engine\
**Created:** [June 19, 2016, 12:54pm UTC](https://community.wowza.com/t/wowza-streaming-curl-command-code-translation-to-the-php/47176 "2016-06-19T12:54:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sanjay\_yadav](https://avatars.discourse-cdn.com/v4/letter/s/ee7513/32.png) [@sanjay\_yadav](https://community.wowza.com/u/sanjay_yadav)\
**Post date:** [June 19, 2016, 12:54pm UTC](https://community.wowza.com/t/wowza-streaming-curl-command-code-translation-to-the-php/47176/1 "2016-06-19T12:54:46Z")

</div>

Hi Guys,

I know this is not the Programming forums but this forums is related to the wowza and my question is totally related to the WOWZA.

I have check this JSON String

[https://www.wowza.com/docs/stream-targets-query-examples-push-publishing](https://www.wowza.com/docs/stream-targets-query-examples-push-publishing)

```auto
<?php
$username = 'test';
$password = 'test';
$data = array(
"restURI" => "http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/myStream/pushpublish/mapentries/ppsource",
"serverName" => "_defaultServer_",
        "sourceStreamName" => "myStream",
        "entryName" => "RTMP",
        "profile" => "rtmp",
        "host" => "rtmp",
        "application" => "myStream",
        "streamName"=> "test",
        "userName" => "",
        "password"=> "",
        "debugPackets"=>"true",
        "sendReleaseStream"=>"false",
        "sendStreamCloseCommands"=>"false",
        "debugLog"=>"true",
        "destinationName"=>"rtmp",
        ); 
    $data_string = json_encode($data);
$url = 'http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/myStream/pushpublish/mapentries/ppsource';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    'Content-Type: application/json',
    'Content-Length: ' . strlen($data_string))
);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_USERPWD, $username . ':' . $password);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec( $ch );
echo $result;
echo "data";

```

ERROR:

```auto
HTTP/1.1 401 Unauthorized
        Content-Type: text/xml; charset=UTF-8
        Date: Fri, 17 Jun 2016 18:43:07 GMT
        Accept-Ranges: bytes
        Server: Restlet-Framework/2.2.2
        WWW-Authenticate: Digest realm="Wowza", domain="/", nonce="dfsdfdfsdfsdfsdfsdfsdfTRlYjE1ZTgzZGYxODFmODQyZjYwYg=="algorithm=MD5, qop="auth"
        Connection: keep-alive
        Transfer-Encoding: chunked
       <?xml version="1.0" encoding="UTF-8" standalone="no"?><error><wowzaServer>4.2.0 < /wowzaServer><code>401</code><message>The request requires user authentication</message></error>data</body>
*<message>The request requires user authentication</message>*

```

I am getting

```auto
USER Authentication problem

```

any help will apprenticed.

THANKS in advance.

---

<div class="post-metadata">

**Author:** ![Jason\_Hatchett](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/jason_hatchett/32/391_2.png) [@Jason\_Hatchett](https://community.wowza.com/u/Jason_Hatchett)\
**Post date:** [July 5, 2016, 2:39am UTC](https://community.wowza.com/t/wowza-streaming-curl-command-code-translation-to-the-php/47176/2 "2016-07-05T02:39:06Z")

</div>

Hello,

Have you followed the steps here previously:

> **[Access reference documentation for the REST API](https://www.wowza.com/docs/how-to-access-documentation-for-wowza-streaming-engine-rest-api)**
>
> Enable the local servlet and download reference documentaion for the Wowza Streaming Engine REST API.

to disable the authentication?

Can you then make these calls through the documentation interface?

If this has already been tested, can you post what you now have for:

> On the computer that has the Wowza Streaming Engine software installed, open the [install-dir]/conf/Server.xml file in a text editor.
> 
> Change the / property from:
> 
> digest
> 
> to:
> 
> DocumentationServerAuthenticationMethod\>none

Regards,

Jason Hatchett
