Last Updated: July 25, 2019
· electblake

Local PHP Development Server like Node.js on OSX

I really enjoy the way other languages allow for non-daemon style webservers (built-in). PHP has added this option, so enjoy foreman or whatever process managers you need to run redis, etc.etc :)

Install PHP:
One Line Installation

All you need to do to install the whole thing is opening up a Shell and execute the following line:

PHP 5.4 (Old stable)

curl -s | bash -s 5.4

PHP 5.5 (Current stable)

curl -s | bash -s 5.5

Run Webserver per Directory!

Example - Starting with a specific document root directory

cd ~/public_html

php -S localhost:8000 -t foo/

2 Responses
Add your response

It's will work only for php greater than 5.4.0. So, using php 5.3.x in this context is wrong.

over 1 year ago ·

@gwinn, very right. Updated

over 1 year ago ·