I’ve written a patch for a GPL’ed JavaScript library. To check how the patch works one needs sample CGI (or PHP) backend.
I want to write a demo PHP to show that my JS works and put the open code on my site.
The question: What it the best way to have PHP on server both executed and viewed as the source?
Note that recently I have ordered a Virtual Private Server with a 5 Gb disk, so there are no troubles with installing new software (if any needed) for me.
The official PHP website itself , I believe, is a good example.
For every page, you have a link to its source code at the bottom of it. For example the download page has its source available publicly; by the way, the page which displays the source can display its own source as well.
As a side note, while the concept of showing both the runtime result of the page and its source code is interesting on php.net, make sure to watch only the concept itself, not the source code of the downloads page. After browsing it, I’m quite surprised about how terrible it is.