# Wowza Engine Rest API PHP

**URL:** <https://community.wowza.com/t/wowza-engine-rest-api-php/92133>\
**Category:** Wowza Developer Dojo\
**Created:** [October 14, 2020, 12:59pm UTC](https://community.wowza.com/t/wowza-engine-rest-api-php/92133 "2020-10-14T12:59:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lorenzo\_Nargiso](https://avatars.discourse-cdn.com/v4/letter/l/58f4c7/32.png) [@Lorenzo\_Nargiso](https://community.wowza.com/u/Lorenzo_Nargiso)\
**Post date:** [October 14, 2020, 12:59pm UTC](https://community.wowza.com/t/wowza-engine-rest-api-php/92133/1 "2020-10-14T12:59:52Z")

</div>

Hello everyone, I’m trying setup this library to manage Wowza engine from my application.  
I’ve installed library with composer.

If I run

```auto
$server = new Com\Wowza\Server($setup);

$sf = new Com\Wowza\Statistics($setup);
$response = $sf->getServerStatistics($server);

```

Everyting works fine.

If I run function like StreamTarget in this way:

```auto
$sf = new Com\Wowza\StreamTarget($setup, 'live');
$response = $sf->remove('ppsource');

```

Or like this

```auto
$sf = new Com\Wowza\StreamTarget("live");
$response = $sf->getAll();

```

Or like this

```auto
$sf = new Com\Wowza\StreamTarget("live");
$response = $sf->create("myStream","ppsource","rtmp","locahost",null, null,"myStream");

```

I got this error:  
`syntax error, unexpected 'public' (T_PUBLIC), expecting ',' or ';' in .../wowza/wse-rest-library-php/src/StreamTarget.php on line 24`

To be clear, this is my $setup:

```auto
$setup = new Com\Wowza\Entities\Application\Helpers\Settings();
$setup->setHost(WOWZA_HOST);
$setup->setUsername(WOWZA_USERNAME);
$setup->setPassword(WOWZA_PASSWORD);

```

This is my $server (if needed)  
`$server = new Com\Wowza\Server($setup);`

I’m using PHP5.5.

P.s There is a differenze from using “com\wowza…” or “Com\Wowza…”? On tests inside library, I’m finding always lowercase, but for my configuration works only with 1st character capitalized.

Thank you

---

<div class="post-metadata">

**Author:** ![Karel\_Boek](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/karel_boek/32/454_2.png) [@Karel\_Boek](https://community.wowza.com/u/Karel_Boek)\
**Post date:** [October 15, 2020, 6:07am UTC](https://community.wowza.com/t/wowza-engine-rest-api-php/92133/2 "2020-10-15T06:07:29Z")

</div>

Are you using the latest version of the REST library for PHP? Because on July 1st, there was a small update that fixed that exact bug:

> <https://github.com/WowzaMediaSystems/wse-rest-library-php/commit/cfab8990337f085be6f2c98d8306c0252b388d48>

---

<div class="post-metadata">

**Author:** ![Lorenzo\_Nargiso](https://avatars.discourse-cdn.com/v4/letter/l/58f4c7/32.png) [@Lorenzo\_Nargiso](https://community.wowza.com/u/Lorenzo_Nargiso)\
**Post date:** [October 15, 2020, 6:25am UTC](https://community.wowza.com/t/wowza-engine-rest-api-php/92133/3 "2020-10-15T06:25:48Z")

</div>

Thank you for reply, I’ve installed that with composer.

`composer require "wowza/wse-rest-library-php:dev-master"`  
Is this correct? (this is from git page)

I’ve checked that file and maked the exact fix, but still does not work.

---

<div class="post-metadata">

**Author:** ![Lorenzo\_Nargiso](https://avatars.discourse-cdn.com/v4/letter/l/58f4c7/32.png) [@Lorenzo\_Nargiso](https://community.wowza.com/u/Lorenzo_Nargiso)\
**Post date:** [October 16, 2020, 2:41pm UTC](https://community.wowza.com/t/wowza-engine-rest-api-php/92133/4 "2020-10-16T14:41:11Z")

</div>

Seems line 50 and 77 got some error  
`$this->port = (!is_null($port)) ? ($int)$port : $this->port;`

Converted in  
`$this->port = (!is_null($port)) ? (int)$port : $this->port;`

Lib to create a Stream Target get inside function 9 arguments.  
In my case, if I need to configure an advanced stream target, I have to update that with cURL? Or have to extend lib?  
For example if I need to configure an Akamai stream target, I can create the stream target with that but can’t add directly from API values as Akamai streamid.
