Installation

Now I am going to show you how to install platform PT. Since the framework was intended to be used in our own environments in the first place, it does not have a fancy installation routine (yet).

What you will need to run platform PT:

Actually I can think of different environments, in which platform PT should run as well. This one is tested though ;)

First of all you will have to place the files into directory used to serve the page. Generally it is a very good idea to place critical files outside the publicly accessible directory. This does not put you in danger if the PHP files wont’t be parsed for any reason. There are passwords in cleartext in the PHP code.

So if your pages are served from the directory

/home/platform/web/htdocs

for example, try to put the files into the

/home/platform/web

directory.

There are different (default) names for the web directory around, including “htdocs”, “httpdocs”, “public_html”… It does not matter to us. Just place the index.php and the .htaccess file into the web directory along with any other public files like images, javascripts, stylesheets.

You should have a structure like this:

/home/platform/web/base.xml
/home/platform/web/build
/home/platform/web/data
/home/platform/web/[htdocs*]
/home/platform/web/[htdocs*]/.htaccess

/home/platform/web/[htdocs*]/index.php
/home/platform/web/inc

/home/platform/web/lib/home/platform/web/modules

/home/platform/web/templates/home/platform/web/text

Where [htdocs*] should be replaced with whatever name your web directory has. Alternatively you can put all the files into the web directory, but I do not recommend it.

platform PT looks for the file base.xml. Wherever this (valid) file lies, it will become the script root (internally), and the directory will be stored in a constant named SCRIPT_BASE.

Next thing to do: make sure the web server user has write access to the “data” directory.

Now it’s configuration time. I will “chroot” our installation now, leaving my example. You will need to edit/create/rename the following files

./inc/config.inc.php (may be taken from ./inc/config.inc.php.example)
./[htdocs*]/.htaccess (./[htdocs*]/.htaccess.example

We will do a very basic installation of platform PT, which means we will leave some things unconfigured, thus configuring only what is required.

config.inc.php:

$db['dsn']  = 'mysql:host=localhost;dbname=db';

$db['user']     = 'mysqluser';

$db['password'] = 'mysqlpassword';

...

$env['baseuri']      = 'http://www.respice.net/';

The $db['dsn'] follows the database source definition of PDO. Please include a trailing slash.

The $env['baseuri'] should take the URI value of your application.

# .htaccess
php_flag register_argc_argv off
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.* index.php

Usually you will only have to change the RewriteBase directive. If your application lies in the domain root (http://www.respice.net/), the RewriteBase will be “/”. If you have a subdirectory (http://www.respice.net/platformpt/) where the application runs, change the RewriteBase to the directory (”RewriteBase /platformpt/”).

That should do the trick.

If you open the website, you should see a blank page with “respice – platform PT” in a heading. If your mod_rewrite is configured properly it should be the same, when you access a (non-existing) subfile.

In the next part I will show you how to start writing a first application.

Kommentare

One Kommentar zu “Installation”

  1. seong. » Blog Archive » Creating a blog app in platform PT pt 1 ;) am Juni 29th, 2007 8:26 pm

    [...] should have a plain installation of platform PT as described here. To obtain platform PT, grab the latest version from the SVN repository: [...]

Schreibe einen Kommentar