PHP 5.4 comes with an embedded server for development purposes. This is what I expected for several months, because so far I had to parse a PHP script that listens for incoming connections and processes them (because I do not want to go into the problems and overhead of installing a real server).
The main thing I can worry about: how can I assign a port?
In my PHP script, I used this:
socket_bind($sock,"localhost",0) or die("Could not bind socket"); socket_getsockname($sock,$ip,$port);
$port will be the $port number assigned by the OS based on what is available.
I'm just wondering if any such function exists on the embedded PHP server, and if so, what should be access to the command line.
php
Niet the dark absol
source share