Friday, November 09, 2007

Setup PHP on Xitami

Recently I had a nessecity to quickly setup PHP development environment. I've read a couple of HOW-TO articles, and since it was not so easy to install IIS on my laptop, I decided to download and install Xitami 2.5 web-server. PHP 5.20 installer claims that it will configure this server automatically, but apparently it does not (I suspect that it was because I've installed everything to %Program Files%). Ok, there was a manual step-by-step instruction, but it also doesn't work very well. At the end of the day, I found the following:

  • If you specify php-cgi.exe as a filter for .php-extension, it will not work with aliases, only with real directories under your web-root
  • If you use php.exe, it will work with your aliases, but it $_GET and $_POST will always be empty
So the solution is to use php-cgi together with symlinks.


pavel said...

Another option is to install Apache and configure it handle PHP.

Andrew Zaikin said...

Absolutely - if you know how to configure apache :)

pavel said...

Just install Apache from its msi/exe distribution package. No special configuration required, just follow the setup.

You can find the appropriate build as:

Next, install the PHP, just by unzipping its package.

Then, edit Apache config as written at accompanied documentation, for instance, for Apache 2.x:

10 minutes task.

btw, you could use the same Apache instance for Tomcat, Proxy and web sever.