>> Table of Contents >> Developer's Manual

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

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:

  1. Basic installation
    1. Unpack Server2Go.
    2. Copy the Yana PHP-Framework in the directory "htdocs/".
    3. 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.
    4. 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);

  2. Database configuration

    If your program requires a MySQL database, do the following:

    1. Edit the file "pms_config.ini" in the Server2Go directory and activate MySQL using "UseMySQL=1".
    2. Start Server2Go by running the file "Server2Go.exe".
    3. It will automatically open your browser. On the front page, in the right menu, click the link to PHPMyAdmin. The URL is: Click this link, or call the address directly by typing it in your browser.
    4. 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.
    5. If you need to change the database connection for the framework, you will find the connection settings in the file "htdocs/yana/config/".
    6. 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.
    7. 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.
  3. Server2Go - Configuration

    After installing your databases, continue with the configuration.

    1. 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.
    2. 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.
  1. Install Firefox Portable
    1. 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).
    2. 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.
    3. 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".
    4. When you are done, restart the browser.
  2. 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.

    1. Open the file "pms_config.ini".
    2. Change the value "BrowserTyp " to EXTERNAL"
    3. Change the value "BrowserPath" to "FirefoxPortable/FirefoxPortable.exe"
    4. Save and close the file.
    5. Create a new file: "Firefox Portable/FirefoxPortable.ini" with the following contents:
      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.

Author: Thomas Meyer, www.yanaframework.net