Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Standalone (portable) PHP CLI Binary

For teaching purposes, I am looking for standalone PHP binaries for Mac, Windows and, possibly Linux.

The plan is to distribute the binary as a single file to students for testing PHP scripts without having to install a full web server. I would expect to be able to use the CLI to do something like this:

# (Mac)
cd php-binary
./php …


# (Win)
cd php-binary
.\php.exe …

In particular I would like to be able to execute:

php -S localhost:8000

I need to ensure that the binary has everything statically installed, so there are no dependencies on external libraries, and no version issues.

The question is, are such binaries freely available? Failing that, can they be readily compiled?

like image 959
Manngo Avatar asked Aug 22 '15 08:08

Manngo


1 Answers

I was looking for a solution to the same problem and stumbled across a project by Zach Shaw (http://www.zachsaw.com/?pg=quickphp_php_tester_debugger).

Although it doesn't run a webserver using the common PHP syntax:

    php -S localhost:8000

It does however, allow you to develop, test and debug PHP scripts using any web browser.

like image 75
Elliot Alderson Avatar answered Oct 05 '22 02:10

Elliot Alderson