PHPSurveyor on OS/2 Warp

This is a quick readme for setting up PHPSurveyor in OS/2 Warp or
eComStation.  It took me a while to get things up and running, so I
thought I'd pass on what I've learned to anyone else who is trying to
run PHPSurveyor on OS/2 Warp.

Pre-Requisites

First, I'm assuming you have at least OS/2 Warp 3.0 with one of the
later Fixpaks (at least FP32), Warp 4, MCP, WSEB, or eCS.  To get
PHPSurveyor running under OS/2, you'll need the following installed:

EMX Runtime 0.9d (Free)
http://hobbes.nmsu.edu/pub/os2/dev/emx/v0.9d/emxrt.zip

PHP for OS/2 (Free - Tested with version 4.3.10)
http://silk.apana.org.au/php/

MySQL 4.0.18b5 (Free - Needs the above EMX runtime)
http://www.os2power.com/yuri/mysql2/index.html
-Note, you may be able to get it running on a later version of MySQL,
but I was not successful with this

Warpin (Free - needed for installation of MySQL)
http://warpin.netlabs.org/

A web server, I have tested successfully with the following 3:

Web/2 (Free)
http://dink.org/web2/

Apache 2.0.53 (Free)
http://silk.apana.org.au/apache/apache_v2.shtml

Apache 1.3.33 (Free)
http://silk.apana.org.au/apache/

For sending email, you'll need an SMTP server installed.  The following
options are available:

Sendmail (Free - needs the EMX runtime)
http://hobbes.nmsu.edu/pub/os2/apps/internet/mail/server/sendmail-8-12-3-bin.zip
http://hobbes.nmsu.edu/pub/os2/apps/internet/mail/server/sendmail8.9.3.zip

*Note that the IBM TCP/IP stack does contain a version of Sendmail.
However the version contained in the IBM stack is very old, offers
little protection from people using it as a relay, and I've found that
some emails sent by it just don't get through.  I do NOT recommend using
the IBM sendmail shipped with the TCP/IP stack!

Weasel combined with Qmail ("Optional Shareware" - Qmail is available on
the "Tools" page)
http://eepjm.newcastle.edu.au/os2/Weasel.html

*Note: For getting the PHP - Email set up and running, I found that
Weasel offered the easiest route to go.

I'm not going to review installing all of the above.  Each package (with
perhaps Sendmail being the exception) contains a good set of
documentation which covers getting it up and running.

Web/2 Setup

If you chose to use Web/2 as your web server, there are 2 things to
note.

First, you'll need to copy the php.exe file from the "\CGI" directory in
your PHP directory to your web\cgi-bin directory (or wherever you've
installed web/2).  You'll also need to have the PHP4.DLL file (also in
the PHP directory) somewhere in your Libpath.  

Then you'll need to start Web/2 from a CMD file just to be sure you have
all the environment variables setup.  Here's a copy of my web2.cmd file:


set path=%PATH%C:\WEB\CGI-BIN;
set BEGINLIBPATH=C:\WEB\CGI-BIN;
@echo off
:top
web.exe %1 >> weberr.log 2>>&1
if errorlevel 248 goto end
goto top
:end



Finally, you'll need to modify the alias.cfg to redirect a URL to
wherever you plan to install PHPSurveyor.

The only other comment about Web/2 is if you use it as your webserver,
you'll need to run its addpuser.exe on the \phpsurveyor\admin directory
to password protect the PHPSurveyor administrator system (See the
phpsurveyor documentation for more information on protecting the admin
system)

Apache

I didn't run into any difficulties setting up Apache.  Just follow the
directions in the readme files and you should be fine.


PHP Setup

Aside from making sure your PHP4.DLL is some place which is in your
libpath, the biggest issue I had with my PHP Setup was getting the
outbound email working.  Eventually I did finally get Senddmail 8.12.3
working, but it ran slow.  I found the easiest was to install Weasel (a
small POP and SMTP email server), and run the Qmail.cmd script.  Doing
this, email went out quickly and got to where it was intended to go.

Here's the appropriate setup lines from the PHP.INI file:

[mail function]
sendmail_path = "c:/weasel/qmail.cmd"

As long as Weasel is set up properly, sending invites, reminders, etc
from PHPSurveyor will work.

For sendmail, the setting I found to work was:

sendmail_path = "c:/sendmail-8.12/sendmail.exe -t -i"

MySQL

For MySQL, I tried Versions 3.23.50, 4.0.18b5, and 4.1.7b2.  Both
Version 3.23.50 and 4.0.18b5 worked well.  I was never able to get
Version 4.1.7 to work with PHPSurveyor, although this could just be
because I didn't try enough, I don't know.  Anyways, my recommendation
is to go with 4.0.18b5 since it works without much difficulty.

Read through the documentation on MySQL on setting it up.  The one issue
that I did find is in the file:  my.cnf if you're running v4.0.18 or
v4.7.1 you'll need to REMOVE the following line:

preload-client-dll

That line works fine in the older 3.23.50, but anything above that, it
just doesn't work.  Also, you'll need to have the following in your
config.sys:

SET EMXOPT=-c -n -h1024

If you do decide to try to use 4.1.7, it was compiled with Innotec GCC,
and so you'll need a few extra DLL's (libc06b2.dll and libc06b4.dll).
You can download them from here:

ftp://ftp.netlabs.org/pub/wvgui/libc06b4.zip

ftp://ftp.netlabs.org/pub/wvgui/libc06b2.zip

Put them somewhere in your libpath.

If you go with 4.0.18b5, you'll need gcc322.dll and libc05.dll somewhere
in your libpath.  Both of these are found in the c:\bin\mysql4\dll
directory.

... and finally PHPSurveyor

For the most part, follow the Windows setup instructions in the
PHPSurveyor docs, although....

-Some directories identified need the forward slash, some need the
backwards slash in your config.php file

A rule of thumb that I've found - if your directory is refering to the
location of PHPSurveyor, use the forward slash as so:

$rootdir            =   "d:/phpsurvey";

If your directory is refering to a place where EXECUTABLELES can be
found, such as MySQL or Apache, use the Backward slash, as so:

$apachedir          =   "c:\apps\apache2\bin"
$mysqldir           =   "c:\bin\mysql4\bin";
$mysqlbin           =   "c:\bin\mysql4\bin";

Confused yet?  It took me a while to figure this out too.

Once all this is set up, start up MySQLD, Weasel, Web/2 (or Apache), and
your Web browser (Firefox, Mozilla, etc).  Point yourself to
http://localhost/phpsurveyor/admin/admin.php and see what happens.  With
any luck you should see the admin screen.

For added performance, check out one of the many applications which
allows you to set the priority of applications (Priority Master, SP.EXE,
etc) and set the priorities of MySQLD, Weasel, and Web/2.

-----

This document has been written by Lorne Tyndale.  If you have any
questions feel free to contact me at:

ltyndale@tyndaleweb.com