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 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"
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.