7

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?

4
  • 1
    Thanks for the downvote, somebody — is there a reason for this? Commented Aug 22, 2015 at 8:49
  • You may link extension libraries statically but you'll still have a dynamically linked binary which requires libraries like libxml, mysql etc. (depending on which features you are about to use). Furthermore you'll need a php.ini file. You should know about this if you are going about to teach students. Commented Aug 22, 2015 at 8:50
  • @hek2mgl: I’m going to teach how to write simple PHP scripts and use this for Ajax. Teaching them how to compile PHP binaries is definitely out of scope, and out of my own experience. Commented Aug 22, 2015 at 8:57
  • 2
    What about preparing a virtual machine, let's say a vagrant box, which has PHP pre-installed, and give this to your students? Commented Aug 22, 2015 at 9:22

1 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.