Put PHP programs on CD-ROM
The following Tutorial will demonstrate, how to use Server2Go and the Yana PHP-Framework to put web application on a CD/DVD-ROM and start them from there.
To complete all steps you will need approximately 1/2 hour plus the time you might need for necessary downloads. References to literature can be found at the end of each section.
system requirements
- Operating System: Windows 98 SE or later
- compatible web browser (e.g. IE 6.0, or Firefox)
- CD-ROM drive
Chapter 1: Download the sources
Before you start with this tutorial, you should make sure that you have finished some preparations, because otherwise you might get to a point of the tutorial, where you can not continue.
Server2Go is donation-ware and may be used, even for commercial applications, for free. The software is developed and maintained by Timo Haberkern.
Basic knowledge of the structure and functions of PHP and MySQL databases are assumed.
Here are some predefined configuration files for Server2Go. These files are based on version 1.5.0. However there are no guarantees.
Here are some links to other useful sources of information:
Chapter 2: Preparations for CD-ROM version
To be able to start a PHP program with the Yana Framework directly from CD-ROM, proceed as follows:
-
Basic installation
- Unpack Server2Go.
- Copy the Yana PHP-Framework in the directory "htdocs/".
- Edit the file "server/config_tpl/php.ini" in a text editor of your choice. Change the value "memory_limit" from "8M" to "16M" or more. Recommended are "128M", the actual value is, however, dependent on your PHP application. Since only one user at a time will access the CD program, you don't hesitate to use a high value.
- Open the configuration file "htdocs/yana/library.php" in a text editor (eg. ConTEXT, or PSPad).
Change the file "library.php" as follows: define('YANA_CDROM', true);
-
Database configuration
If your program requires a MySQL database, do the following:
- Edit the file "pms_config.ini" in the Server2Go directory and activate MySQL using "UseMySQL=1".
- Start Server2Go by running the file "Server2Go.exe".
- It will automatically open your browser. On the front page, in the right menu, click the link to PHPMyAdmin. The URL is: http://127.0.0.1:4001/phpmyadmin/ Click this link, or call the address directly by typing it in your browser.
- Install your databases using PHPMyAdmin. Be sure to use the same name for your database, as you have used for your local installation. Otherwise, you need to change the database connection settings of the Yana PHP-Framework accordingly.
- If you need to change the database connection for the framework, you will find the connection settings in the file "htdocs/yana/config/".
- Install PEAR DB. Open the download page and download the archives for DB and the PEAR package to your computer. You will need a program to decompress these two TGZ archives. If you have none, for example 7-Zip, a free open source program, will do the job.
- The archives are packed 2 times - after you have unpacked the first file, you have to unpacked the second file also. These include some XML files, which you can ignore, and one directory with installation files. Copy the contents of both installation directories to the directory "server/php/pear/ ", so that the files "DB.php" and "PEAR.php" both are placed directly in this directory. This ends the creation of PEAR-DB You can test this by running Server2Go and call the Yana PHP-Framework with the parameter "yana/index.php?action=test". On the side it should be confirmed in green letters that PEAR-DB is available.
-
Server2Go - Configuration
After installing your databases, continue with the configuration.
- To make the task easier, all settings, which you need for your CD-ROM, were preconfigured and the files included in this manual. You only need to unpack the files in the Server2Go installation directory. Replace the old configuration files. The ZIP archive can be found here.
- Then configure the database settings in the file "pms_config.ini" and the auto-start settings as you need it. You also may want to include your own logo.
Then the package can be put on a CD-ROM and used immediately.
In the next chapter, you will learn how Server2Go and Yana PHP-Framework can be used together with the portable edition of the Firefox browser.
Chapter 3: Use with Firefox Portable
You have the opportunity to use the Firefox browser with Server2Go on a CD . The following guide explains how to do that.
Caution: Portable Firefox (as far as is currently known) can NOT be used with version 1.5.1 of Server2Go on CD-ROM, but only on a USB drive or hard disk. The problem is to be solved in a future version. In the meantime, it is possible to use an alternative browser. One of several possibilities is to use the supplementary program "Simple browser", which can be found on the
Server2Go Website. In return the author expects a small donation to support the further development of the software.
-
Install Firefox Portable
- First, you will need a current, portable version of the browser. It can be found on the web site http://portableapps.com. Download this file from the internet and extract it to the Server2Go installation directory (where "Server2Go.exe" resides).
- The browser is in English. However, if you need a German version, it can be converted. To do so, download the German language pack. You can get it on www.firefox-browser.de. Copy the file "de.xpi" to your computer.
- Start FirefoxPortable by executing the file "FirefoxPortable/FirefoxPortable.exe". Install the file "de.xpi", by either dragging it to the firefox window, or by using the menu "File/Open file ..." to open "de.xpi".
- When you are done, restart the browser.
-
Configure Server2Go for Firefox Portable
Note: There is a ZIP archive containing all required configuration files, which you may use alternatively. Unpack the archive and replace the original files. This is it already. You just need put it on a CD-ROM and run your application.
However, if you don't want to use the archive and prefer to complete the steps by hand, then continue with the configuration as follows.
- Open the file "pms_config.ini".
- Change the value "BrowserTyp " to EXTERNAL"
- Change the value "BrowserPath" to "FirefoxPortable/FirefoxPortable.exe"
- Save and close the file.
- Create a new file: "Firefox Portable/FirefoxPortable.ini" with the following contents:
[FirefoxPortable]
FirefoxDirectory=App\firefox
ProfileDirectory=Data\profile
PluginsDirectory=Data\plugins
SettingsDirectory=Data\settings
FirefoxExecutable=firefox.exe
AdditionalParameters=
LocalHomepage=
DisableSplashScreen=true
DisableIntelligentStart=false
AllowMultipleInstances=true
SkipChromeFix=false
SkipCompregFix=false
WaitForFirefox=true
RunLocally=true
Information on the options used here can be found in the file "FirefoxPortable/Other/FirefoxPortableSource/Readme.txt". This file is delivered with Firefox Portable. You may set the value "AdditionalParameters" to "-contentLocale de-DE -UILocale de-DE" if you want to use the German version (or any other locale: just replace the argument "de-DE").
Subsequently, the package can be put on CD-ROM.
Warning: there is the possibility that Server2Go does not work properly on some machines, because of local firewalls or restricted user rights. It is therefore strongly recommended that you test your CD-ROM at least on one other system. Some operating systems may require administrator privileges to start the CD.
Windows Vista: Support for MS Vista was introduced for Server2Go starting from version 1.5.0. It may occur, that users are asked, whether the application may access the system. Up to version 1.5.0 administrator privileges are necessary to start Server2Go from a CD-ROM.
Windows 98: For computers with Windows 98, which have NO Microsoft Office package installed, a patch must be installed, which the user may get from Microsoft. You will find the page at this URL: http://www.microsoft.com/downloads/details.aspx?FamilyID=6c050fe3-c795-4b7d-b037-185d0506396c
To ensure a stable operation it is also necessary to downgrade the MySQL database to version 4. It is sufficient to exchange the files of the database application in the directory "server/mysql/". A suitable installation package can be found at the
Server2Go web site.