# PHP Sockets and Cpanel

**URL:** https://forum.kirupa.com/t/php-sockets-and-cpanel/284497
**Category:** programming
**Created:** [March 19, 2009, 5:49pm UTC](https://forum.kirupa.com/t/php-sockets-and-cpanel/284497 "2009-03-19T17:49:26Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Phoenix401](https://avatars.discourse-cdn.com/v4/letter/p/edb3f5/32.png) [@Phoenix401](https://forum.kirupa.com/u/Phoenix401)
#### Post date: [March 19, 2009, 5:49pm UTC](https://forum.kirupa.com/t/php-sockets-and-cpanel/284497/1 "2009-03-19T17:49:26Z")

</div>

I am attempting to setup socket communication between a PHP server, that is provided to me through a hosting company that provides me with limited CPanel access to the server, and a flash application that will use XML sockets to communicate with multiple users.

I attempted following:  
[http://www.kirupa.com/developer/flash8/php5sockets\_flash8.htm](http://www.kirupa.com/developer/flash8/php5sockets_flash8.htm)

EDIT: I configured the php file to run on 127.0.0.1 and port 9998. I include a crossdomain file that allows connection to ports 1025 - 9999. I am then getting to page 5 in the tutorial where you have to run the .bat file to start the server. The server I am running on is apache so I am at a loss for what to do with this part. When I attempt to run the php file as is I get nothing on the screen the page just remains constantly looping. I removed the

‘#!/usr/bin/php -q’ from the top so I could see something on the screen and I get back:

**Warning** : socket\_bind() [[function.socket-bind](http://www.phoenix.btc217.com/_testing/_socketChat/function.socket-bind)]: unable to bind address [98]: Address already in use in \*\*/home/btc217/public\_html/phoenix/\_testing/\_socketChat/socketTut.php

\*\*so does this mean the server is setup? I couldn’t find specifics to this error.

Previously I also tried executing the php script using exec commands which also seemed to fail to return and then I tried shell\_exec but this was blocked by the servers secruity settings.

In any event I edited the swf file to use the same IP and port number but all I get is ‘not connected’. I also tried changing the  
characters to \0 thinking maybe flash was hanging during the read. In any event I am having serious problems trying to setup these sockets, any help would be appreciated.

Thanks,

~Phoenix
