Run PHP From Flash Key With Server2go
By Stephen Bucaro
Do you want to learn (or teach) PHP and / or MySQL, but don't want to use a
web host or install a web server + PHP + database on your PC? Server2go is a neat little (well
actually 300 MB with all the bells and whistles) application that you can put on a USB flash
drive (no installation required) and run your PHP MySQL webpages from there.
Server2Go can be used directly from a USB flash drive (or CD-ROM or any folder
on a hard disk) without the hassle of configuring Apache, PHP or MySQL. It allows
you to create a standalone working web site or PHP application on a flash drive.
Not amazed yet? Server2Go runs on all versions of Windows from Win 98 and
above (you don't need Linux), and Server2Go is Donationware, so use it for free
and don't have to pay any royalty charges when distributing an application on
CD-ROM that uses Server2Go.
However, if you use it commercially and generate some revenue, it would wise
to share some of it with the Server2Go to help the project with further development.
Download the installation file from
Server2Go, to
your USB flash drive. Then right-click on the .zip file's name, and in the popup
window that appears, select Extract All. There is nothing to install to
use Server2Go.
When you extract the .zip file, it will create a folder Server2Go, inside
that folder there will be an htdocs folder. To run Server2Go, just
double-click on Server2Go.exe. It will create and run a web server (Apache
for Windows) and open the default file index.php in your default
web browser. Note the default IP address of the web server on your flash drive
(127.0.0.1:4001).
The first thing you probably want to do is create your own simple PHP file
to see if you can really run it. Shown below is a simple Hello World
PHP webpage that you can use to test Server2Go:
<html>
<head>
<title>PHP Hello World</title>
</head>
<body>
<?php print("Hello World"); ?>
</body>
</html>
Create the file in Windows Notepad and save it to the htdocs folder.
Then double-click on Server2Go.exe. It will open index.php, just
change the name of the file in the URL to the name of your PHP file. If you
see a webpage displaying the text Hello World, congratulations,
you have just coded your first PHP webpage.
If you want to create your own PHP applications, you need to create a
new folder under htdocs, and enter the name of that folder in
your URL path. When you close the browser, Server2Go will automatically
shut down the Web server.
You may notice that Server2Go does a quick access of your Internet connection
before displaying your file. This is probably to track how many people are
using the application. You don't actually need to have an Internet connection
to run Server2Go.
Now you're free to learn and practice PHP programming without using a
webhost or installing a web server on your PC.
|