title: Running a PHP file on XAMPP versus on php command line
body: <p>I have a chatdemo.php which includes socket.php socket file. Inside the socket.php file there is a line</p>
  
  <pre><code>socket_bind($master, $address, $port);
  </code></pre>
  
  <p>where <code>$address = "localhost"</code> and  <code>$port=1300</code>.</p>
  
  <p>However, when I put onto the browser (and the apache from XAMPP <em>is</em> up) <a href="http://localhost/demo/chatdemo.php" rel="nofollow">http://localhost/demo/chatdemo.php</a> it says:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>So, instead, I goto the command line and did a</p>
  
  <pre><code>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
  </code></pre>
  
  <p><em><strong>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)?</em></strong> </p>