helpinghand
search
needassistance
 
How To
Use Mimer SQL with PHP on Linux
Categories: ODBC, Tools and Interfaces
Introduction

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 www.php.net.

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

Environment

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 www.php.net/downloads.

Example

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 libphp3.so
$ cp libphp3.so /usr/lib/apache/libphp3.so
$ chmod 755 /usr/lib/apache/libphp3.so

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

"LoadModule php3_module libexec/libphp3.so"
"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 libiodbc.2.so, define an environment variable named LD_LIBRARY_PATH that points out the path to your libiodbc.2.so, 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.

Links

ODBC Interface

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

A PHP Coding Standard can be found at pear.php.net/manual/en/standards.php.
Last updated: 2004-01-02

 

Powered by Mimer SQL

Powered by Mimer SQL