I've written a PHP CLI script that executes on a Continuous Integration environment. One of the things it does is it runs Protractor tests.
My plan was to get the built-in PHP 5.4's built-in web server to run in the background:
php -S localhost:9000 -t foo/ bar.php &
You could do it the same way you would run any application in the background.
nohup php -S localhost:9000 -t foo/ bar.php > phpd.log 2>&1 &
Here, nohup is used to prevent the locking of your terminal. You then need to redirect stdout (
>) and stderr (