For offline development I would like to make make a standalone PHP 5.4 binary so I can use the PHP self hosting option. eg php -S localhost:8000 Which would startup a server for hosting PHP files.
Since installing and configuring PHP 5.4 on mac is not trival for non tech people. I would like to be able to include a working PHP binary in my files. So essentially I can run. ./php -S localhost:8000 in my folder and it will work.
I have followed the instruction here to create a standalone PHP binary by running on the source code.
./configure --enable-static --enable-cgi --enable-mbstring\
--enable-force-cgi-redirect \
--with-config-file-path=/etc/php5cgi \
--prefix=/usr/local/php5cgi \
--with-curl \
--enable-sockets \
--with-zlib --with-zlib-dir=/usr/include \
--with-pear
Then editing the Makefile to have -all-static
BUILD_CGI = <other commands here> $(ZEND_EXTRA_LIBS) -all-static -o $(SAPI_CGI_PATH).
BUILD_CLI = <other commands here> $(ZEND_EXTRA_LIBS) -all-static -o $(SAPI_CGI_PATH).
This does work. File is standalone. But when I run the binary.
./php-cgi -h
There is no "-S" option for the built in webserver? Do I need to change something in my configure options to allow the builtin webserver? My source was downloaded from PHP.net (I did download the 5.5 latest source, but that still does have the -S option).
Thanks, John.