# Control HTTP, RTMP & RTSP access through external PHP

**URL:** <https://community.wowza.com/t/control-http-rtmp-rtsp-access-through-external-php/34287>\
**Category:** Wowza Developer Dojo\
**Tags:** wowza-streaming-server-java-api\
**Created:** [January 26, 2012, 11:39am UTC](https://community.wowza.com/t/control-http-rtmp-rtsp-access-through-external-php/34287 "2012-01-26T11:39:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hugo\_De\_Zela](https://avatars.discourse-cdn.com/v4/letter/h/fbc32d/32.png) [@Hugo\_De\_Zela](https://community.wowza.com/u/Hugo_De_Zela)\
**Post date:** [January 26, 2012, 11:39am UTC](https://community.wowza.com/t/control-http-rtmp-rtsp-access-through-external-php/34287/1 "2012-01-26T11:39:33Z")

</div>

I’m trying to control access to streams via an external PHP script that checks the user/pass for the correct privileges for each video but I can’t get it to work with Wowza. I don’t know JAVA programming but I was able to piece together the following code, but it doesn’t even run. I’ve tried running it as stand-alone JAVA and it works fine, but whenever I try to integrate it with Wowza, it dies out with:

```auto
ERROR server comment - server core failure: java.net.BindException: Address already in use: bind
java.net.BindException: Address already in use: bind
	at sun.nio.ch.Net.bind0(Native Method)
	at sun.nio.ch.Net.bind(Unknown Source)
	at sun.nio.ch.Net.bind(Unknown Source)
	at sun.nio.ch.ServerSocketChannelImpl.bind(Unknown Source)
	at sun.nio.ch.ServerSocketAdaptor.bind(Unknown Source)
	at org.apache.mina.transport.socket.nio.SocketAcceptor.registerNew(Unknown Source)
	at org.apache.mina.transport.socket.nio.SocketAcceptor.access$1100(Unknown Source)
	at org.apache.mina.transport.socket.nio.SocketAcceptor$Worker.run(Unknown Source)
	at org.apache.mina.util.NamePreservingRunnable.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)

```

Here is the code I have in the Wowza IDE:

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [January 26, 2012, 6:29pm UTC](https://community.wowza.com/t/control-http-rtmp-rtsp-access-through-external-php/34287/2 "2012-01-26T18:29:22Z")

</div>

The error you show means Wowza is already running. If the service is running, turn it off first. Or Wowza is running in stand-alone mode (/bin/startup.bat) shut that down before running Wowza in the IDE.

Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [January 27, 2012, 2:51pm UTC](https://community.wowza.com/t/control-http-rtmp-rtsp-access-through-external-php/34287/3 "2012-01-27T14:51:24Z")

</div>

Take a look at these examples:

[https://www.wowza.com/docs/how-to-do-user-authentication-for-flash-rtmp-client-using-jdbc-connection-to-mysql-database](https://www.wowza.com/docs/how-to-do-user-authentication-for-flash-rtmp-client-using-jdbc-connection-to-mysql-database)

[https://www.wowza.com/docs/how-to-do-file-based-rtmp-authentication-with-url-query-strings-onconnectauthenticate2](https://www.wowza.com/docs/how-to-do-file-based-rtmp-authentication-with-url-query-strings-onconnectauthenticate2)

Richard
