Mr. Know-It-All has the answers to even the really tough questions.
It's time for me to do a web application and I need to install MySQL and PHP
on my Apache2 server. Is there anything I need to watch out for?
Well, there's always something.
All of the following assumes Apache2 v2.0.49,
PHP v4.3.10 and
The examples that follow assume you are booting from volume C: and that
the applications and data are on volume D:.
Finding the code
First, use the
link to find the WarpIn install packages for v4.1.7.
If you use the old
link, you will be taken to the page for the older v4.0.18.
As of the date of this article, this page not been updated to point to v4.1.7.
Installing the packages
The WarpIn packages install without errors for most users,
but usually do not result in a ready to run MySQL setup.
The install places code>LIBC06B4.DLL in
and does not update
Mr. KIA recommends you move
If the DLL can not be found via a
the server will not start.
The build also requires
which is not included in the WarpIn packages.
If you do not already have a copy, get it from
Mr. KIA recommends you copy the DLL to
If the DLL can not be found via a LIBPATH search,
the MySQL client will not start.
MySQL requires features provided by the
If you do not load this driver,
the MySQL server will not be able to set up the sockets it uses.
My.cnf is optional
The manual is not entirely clear about this.
My.cnf is optional unless you want to change the default settings.
The default settings are OK for getting started.
If, or when, your application needs to be tuned,
you can create
my.cnf with the appropriate settings.
For large databases, it is often a good idea to the keep the database store separate
from the MySQL applications.
This requires specific
When tuning an installation, it is often helpful to turn off the storage engines you
are not using.
This is best done with
Mysql.inf is out of date
The INF version of the MySQL manual is pretty far out of date.
Mr. KIA recommends you bookmark the
MySQL Online Manual
It is well organized and fully searchable.
Since you are also going to be doing PHP coding, you should bookmark the
PHP Language Reference Manual
TMP needs forward slashes
This is one of those places where MySQL shows its unix heritage.
If you have TMP defined as
some work files might end up in the root of the volume.
This is usually just messy unless you neglect to clean up the leftovers.
Mr. KIA recommends that you redefine TMP with
when starting up the MySQL server or client.
This can be done with a script or by editing the MySQL program objects.
MySQL client does not do command line editing
There is a build problem in the v4.1.7 distribution and readline support
is not compiled into the MySQL client.
If you want to have command line history and editing available, download the
v4.0.18 WarpIn package
wic.exe to extract the package contents to a work directory.
to a convenient directory and create a program object for
Mr. KIA chose
PHP extensions not enabled
The PHP v4.3.10 documentation claims the MySQL PHP extensions are enabled by default.
This is not true.
[PHP] section of
PHP DLL locations
New users often get the PHP executable locations wrong.
php4.dll where it can be found with a
Mr. KIA recommends
This assumes your Apache2 startup script contains
Put the standalone version of
php4.exe in the
Put the CGI version of
php4.exe in the
modphp4.dll in the
modules directory does not need to be in
Apache2 takes care of this internally.
You must enable PHP in
LoadModule php4_module modules/modphp4.dll
AddType application/x-httpd-php .php
You must create a
php.ini file in your ETC directory.
The file can be empty, but it must exist or the PHP module will not work.
The default PHP settings are usually fine for getting started.
You should adjust the security settings before releasing your app for production use.
The Internet is full of tips and techniques
for effective troubleshooting of Apache/PHP/MySQL setups.
Mr. KIA will add just a couple here.
Mr. KIA uses the following program object setting to start the MySQL server:
Parameters: /c set TMP=d:/tmp & MYSQLD.EXE --console & if errorlevel 1 pause
Work directory: d:\Apps\mysql41\bin
Mr. KIA recommends setting
display_errors = On
php.ini so that PHP error messages display in the browser window.
Curious or in doubt, you can ask
OS/2 is his specialty and sharing solutions is his passion
Mr. Know-It-All lives in Southern California.
The Southern California OS/2 User Group
P.O. Box 26904
Santa Ana, CA 92799-6904, USA
Copyright 2005 the Southern California OS/2 User Group. ALL RIGHTS
SCOUG, Warp Expo West, and Warpfest are trademarks of the Southern California OS/2 User Group.
OS/2, Workplace Shell, and IBM are registered trademarks of International
Business Machines Corporation.
All other trademarks remain the property of their respective owners.