Print this page.  If your browser doesn't allow JavaScript, right-click this page and choose Print from the popup-menu.        
Use Mimer SQL with PHP on Linux
Categories: ODBC, Tools and Interfaces

PHP is a server-side, cross-platform, HTML embedded scripting language that can be used for building dynamic Web-sites. Much of its syntax is borrowed from C, Java and Perl with a couple of unique PHP-specific features thrown in. The goal of the language is to allow Web developers to write dynamically generated pages quickly. For details see

PHP can be used for free in commercial and non-commercial businesses.


Before you install PHP, make sure that Mimer SQL, Apache and an ODBC Driver Manager all are installed and working.

Download the source-code for PHP at


Unpack and install the PHP source-code by typing:

$ tar -zxmf PHP3-3.0.12.tar.gz

You should now have a directory named PHP3-3.0.12 (or corresponding) in your home directory.

Read the INSTALL files, located in your PHP3 directory, for more details about your installation. Useful tips about a PHP-installation used under RedHat Linux can be found in INSTALL.REDHAT.

To see all available options for the PHP installation, type the following:

$ ./configure –help

We will now install PHP as a shared Apache module with ODBC support.

Move to your PHP directory and enter the following commands. (Note: check where your apxs is located, it doesn't have to be in /usr/sbin/).

$ ./configure --with-apxs=/usr/sbin/apxs --with-iodbc
$ make
$ make install

The command ’make install’ should generate something like:

$ /usr/sbin/apxs -i -n php3
$ cp /usr/lib/apache/
$ chmod 755 /usr/lib/apache/

Now open the file httpd.conf, which is probably located in /etc/httpd/conf/, and activate the following lines:

"LoadModule php3_module libexec/"
"AddModule mod_php3.c"

In the file srm.conf (located in the same directory as httpd.conf), add the lines (or activate them if they already exist):

"AddType application/x-httpd-php3 .php3"
"AddType application/x-httpd-php3-source .phpS"

Now restart your Web server:

$ /etc/rc.d/init.d/httpd restart

Note: if your server can’t locate the file, define an environment variable named LD_LIBRARY_PATH that points out the path to your, for example:

$ export LD_LIBRARY_PATH = /usr/local/lib

If the installation succeeded, you should now be able to run the ODBC tests that came with the PHP3 installation. Copy the test files from your PHP3 directory (php3-3.0.12) to your Web-root and run the test with your Mimer SQL database!

Note: if the odbc-t3.php3 test doesn't work properly, try changing the query from "SELECT COUNT(*) FROM PHP3_test" to "SELECT COUNT('*') FROM PHP3_test" instead.


ODBC Interface

Mimer SQL Documentation Set, PDF-file (especially see the Programmer's Manual).

A PHP Coding Standard can be found at
Last updated: 2004-01-02


Powered by Mimer SQL

Powered by Mimer SQL