| Home | See http://www.php.net/docs.php for complete PHP programming documentation. |

How-to: Test PHP Web Pages on a Stand-alone Windows Computer Using “XAMPP Lite”

By Howard Best, August 4, 2008

(LLBest.com, )


Note: This implementation of the Apache server is called “XAMPP lite for Windows.” It is completely “portable,” in other words, no installation is required, and it will even work on a flash drive.

These instructions should work on any stand-alone (no Internet connection necessary once the software is downloaded) Windows 98 or later computer, but so far I've only tested them on a Windows XP computer. They assume that the extensions for known file types are not hidden. (1. Double click “My Documents.” 2. Click “Tools / Folder Options….” 3. Click the “View” tab. 4. Make sure that “Hide extensions for known file types” is unchecked.)


1. Go to http://www.apachefriends.org/en/xampp-windows.html#646, click “EXE (7-zip)” and download “xampplite-win32-….exe” to your desktop. (Right now it’s an 18.6 MB file called “xampplite-win32-1.6.7.exe.”)

2. Double-click the “xampplite-win32-….exe” (“7Z”) icon.

3. Click the “Extract” button.

4. A folder named “xampplite” will be created on your desktop.

5. “xampplite-win32-….exe” may now be deleted.

6. Move the “xampplite” folder to your “My Documents” folder.*

7. Within the “xampplite” folder, double click “apache_start.bat.”

8. You should then get a window that says, among other things, “Apache could not be started.”

9. Close the window.

10. Double click “setup_xampp.bat.”

11. You should see:
Screen capture of XAMPPlite setup

12. Double click “apache_start.bat” again.

13. This time, you should see:
Screen capture of XAMPPlite starting up

14. Click: http://localhost/xampp/index.php and you should see the following:
Screen capture of XAMPPlite welcome screen

15. Click “Status,” and you should see:
Screen capture of XAMPPlite status screen

16. Inside the “xampplite\htdocs” folder, create a new folder called “MWS” (my websites).

17. Inside the “xampplite\htdocs\MWS” folder, create a new folder called “test.com” (an example of one of your websites).

18. Using Notepad, create a text file called “index.php” in the “xampplite\htdocs\MWS\test.com” folder, and put the following into it:

<html>
<head>
<?$T1='PHP Example'?>
<title>Test - <?echo$T1?></title>
</head>
<body bgcolor=silver>
<center><table height="100%"><td>
<span style="background:gainsboro;padding:4">
<h1><?echo'&nbsp;'.$T1.' &shy;'?></h1>
</span>
</td></table></center>
</body>
</html>

19. Click: http://localhost/MWS/test.com/.

20. “PHP Example” should appear in the middle of your web browser window!

21. “Bookmark” it, or save it as one of your “Favorites.”

22. To close down the Apache server, double click “apache_stop.bat.”

23. You might want to put shortcuts to “apache_start.bat” and “apache_stop.bat” on your desktop.


TESTING “PERL CGI” WEB PAGES

1. Go to http://www.activestate.com/Products/ActivePerl/.

2. Download “ActivePerl” for Windows.

3. Install “ActivePerl” in the folder “C:/usr.”

4. Then “.cgi” web pages beginning with:

#!/usr/bin/perl -w
use CGI qw(:standard);
…, which is the usual way to do it on the Internet, will also work on your stand-alone computer when the XAMPP lite Apache server is running.


* If you want an extremely convenient way to test your websites on multiple computers, then put the “xampplite” folder in the root directory of a flash drive. The reason for putting it in the root directory is that the flash drive might not always have the same drive letter which means that you will have to again double click “apache_start.bat,” which works more reliably when the “xampplite” folder is in the root directory.


| Home | THIS WEB PAGE URL: http://LLBest.com/TestingPHPWebPagesOffline2.htm |