phpW2ML installation

Requirements

This software was developped with Apache 2.2 on Linux but should work on any operating system and web server with a PHP 5 interpreter.

Quick install

  1. Uncompress the phpW2ML archive.
    Example with phpW2ML v0.3 archive:
    tar xfz phpW2ML-0.3.tar.gz
  2. The uncompressed archive contains 3 directories: phpW2ML, w2mlclient, and w2mldocs. Copy them to the document root of the web server.
    Example with /var/www/ as document root:
    cd phpW2ML-0.3; cp -r phpW2ML w2mlclient w2mldocs /var/www/
  3. Change permissions of w2mldocs and *.w2ml files inside w2mldocs to be read-writable by the PHP interpreter.
    Example with PHP interpreter running as a user of group www-data:
    cd /var/www; chgrp -R www-data w2mldocs; chmod g+w w2mldocs w2mldocs/*.w2ml
  4. Load http://localhost/phpW2ML/index.php?w2mldoc=index.w2ml to check that "W2ML does work!"

Note: The Unix command line was used in the examples, they have to be adapted for other operating systems.

Installed files and directories

The phpW2ML archive is made of 3 components distributed in 3 directories:

phpW2ML/
The W2ML processor, made of PHP files.
w2mlclient/
The online editor, made of JavaScript and GIF files.
w2mldocs/
W2ML applications made of W2ML files and bitmapped fonts.

Note that an .htaccess file is present in the w2mldocs directory to deny access to W2ML files directly from the HTTP server. W2ML files can only be read through the phpW2ML processor, and so they cannot be served as raw W2ML. It means that if your wb configuration allows .htaccess, then access to http://localhost/w2mldocs/index.w2ml gives 403 forbidden.

Configuration

The default configuration in phpW2ML/index.php expects that w2mlclient and w2mldocs directories are installed in the document root of the web server.

In phpW2ML/index.php, the path to the w2mldocs directory is configured by:
define('W2ML_DOC_ROOT', realpath($_SERVER['DOCUMENT_ROOT'].'/w2mldocs').'/');
This path can be freely changed, but the W2ML files distributed with phpW2ML in w2mldocs expect to find bitmapped fonts under the /w2mldocs/fonts/ URI. Note that W2ML files should be writable by the PHP interpreter, otherwise W2ML markup modifying files (edition, counter...) becomes ineffective.

In phpW2ML/index.php, the URI of the w2mlclient directory is configured by:
define('W2ML_CLIENT_URI', '/w2mlclient/');