I have a chatdemo.php which includes socket.php socket file. Inside the socket.php file there is a line
socket_bind($master, $address, $port);
where $address = "localhost" and $port=1300.
However, when I put onto the browser (and the apache from XAMPP is up) http://localhost/demo/chatdemo.php it says:
Warning: socket_bind() [function.socket-bind]: unable to bind address [48]:
Address already in use in /Applications/XAMPP/xamppfiles/htdocs/demo/socket.class.php on line 23
socket_bind() failed
So, instead, I goto the command line and did a
php -q /demo/chatbot.demo.php
Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Los_Angeles' for 'PDT/-7.0/DST' instead in /demo/socket.php on line 21
Server Started : 2012-03-27 17:24:24
Listening on : localhost port 13000
Master socket : Resource id #5
So the question is: Why can't I run that chatdemo.php on my browser on localhost(using XAMPP), whereas I could executed that on the command line using php(non-XAMPP)?