views:

30

answers:

1

Is there a way to distribute a PHP program like a desktop app, so that even if the user of the app doesn't have a local server environment setup on there PCs, the app will still work?

I was thinking, if there was some type of portable server environment program which includes PHP/Apache, then we could create a batch file which when clicked would start up apache in the portable program and launch the PHP app in the user's default browser. That way PHP apps could be distributed like desktop apps.

But the question is, is there such a portable server environment program that can be used for this?

+1  A: 

Yes, if you google for XAMPP portable, you can find several versions of fully portable, fully functioning xampp servers for the go. You would have to make sure it contains all the security settings and extensions you need.

The file your user launches should be an .html file to be sure it opens in your browser. As you need to point the user to his own localhost to run your app (otherwise PHP won't be executed and he'd see a plain html file), you'd have to create a redirect, possibly using javascript or a simple "click here to start" link.

PeerBr