A Step by Step Guide To Configure Informix On Linux PDF
A Step by Step Guide To Configure Informix On Linux PDF
A Step by Step Guide To Configure Informix On Linux PDF
Summary: Learn how to install, configure, and test a Linux®, Apache®, Informix®, and PHP
(LAIP) server. LAIP provides a very powerful and dynamic mixture for a Web server.
This article assumes the use of an RPM-based 32-bit Linux system. The steps provided have been
completed on Red Hat Enterprise Linux 4 and SUSE Linux 9. However, the overall ideas can be
conveyed across any Linux distribution.
Pre-installation steps
First, you need to have the Informix Dynamic Server and the Informix Software Development Kit.
If you do not have these products, you can find them on the Informix product family page.
Most Linux distributions come with some or all of the LAIP components pre-installed. They are
generally not installed from the source, and therefore may not have the correct extensions
compiled in. In order to remove these components, and not fall into RPM trouble, you must first
be logged in as root:
su - root
You can then look for all of the packages that are currently installed on your system:
1 of 12 20/01/11 12:25
A step-by-step how-to guide to install, configure, an... http://www.ibm.com/developerworks/data/library/...
You can then remove all of the packages found in the above commands:
rpm -e filename
You should now have a "clean" Linux distribution ready for component installation and setup.
The following versions of the LAIP products are used during this setup:
PHP 5.1.2
Apache HTTP server 2.2.0
Informix Dynamic Server (IDS) 10.00.UC4
Informix Client Software Development Kit (Client SDK) 2.90.UC4
Informix PHP Data Objects (PDO) 1.0.0
A different version of the above products may require a different set of steps for the setup to
work properly. The steps given are unique to the products above. However, the general ideas can
be followed across versions.
To install Informix onto your Linux environment, perform the following steps:
1. Check if any patches are needed for your operating system. You can go to the Informix
Dynamic Server page to see if any patches are needed.
2 of 12 20/01/11 12:25
A step-by-step how-to guide to install, configure, an... http://www.ibm.com/developerworks/data/library/...
2. Create the Informix user and group. The Informix user acts as the root account for the
Informix database. Keep this account highly secured. Creation can be done as follows
(where xxxx is the password for the user Informix):
groupadd informix
useradd -g informix -p xxxx -d /dev/null informix
3. Create the installation directory. The default location is /opt/informix. Also, the last two
commands are to ensure that the directory is owned by the Informix user and group:
su informix mkdir /opt/informix
chown informix.informix /opt/informix
chown informix.informix /opt/informix
4. Set up all the environment variables needed. The INFORMIXDIR should be the location you
used to install Informix. Using the default is done as follows: Bourne Again shell (bash):
INFORMIXDIR=/opt/informix
export INFORMIXDIR
PATH=$PATH:$INFORMIXDIR/bin
export PATH
or
C shell (csh):
setenv INFORMIXDIR /opt/informix
setenv PATH ${PATH}:${INFORMIXDIR}/bin
5. Extract the Informix files with the given Informix tar file. If the tar file of the Informix Server
and Client SDK are in the current directory, extracting the files is done as so (if the file is
something like IIF*.tar):
mv IIF*.tar /opt/informix
cd /opt/informix
su informix tar -xvf IIF*.tar
6. Go to the extracted files and run the installation of the IDS. There are three methods of
installing IDS. The default is the console method. There is also the graphical and silent
method. You can choose whatever suits your needs. The console method is used in this
example. The console method can be run as follows:
./install_rpm -acceptlicense=yes
After running the script, simply follow the on-screen instructions to complete the
installation of Informix. Be sure to use the /opt/informix as the installation directory. The
accept license flag should only be added if you accept the Informix license.
3 of 12 20/01/11 12:25
A step-by-step how-to guide to install, configure, an... http://www.ibm.com/developerworks/data/library/...
mv client*.tar /opt/informix
cd /opt/informix
su informix tar -xvf client*.tar
8. Run the installation script to install the Client SDK. After running the script, simply follow
the on-screen instructions to complete the installation of the Client SDK portion of Informix:
./installclientsdk
1. Create environment files needed to bring the Informix server up and running. An .informix
file is created in the home directory with the following contents: Bourne Again shell
(bash):
set INFORMIXDIR=/opt/informix
set INFORMIXSQLHOSTS=/opt/informix/etc/sqlhosts
set ONCONFIG=onconfig
set INFORMIXSERVER=myserver
set SERVERNUM=1
set PATH=$INFORMIXDIR/bin:.:$PATH
or
C shell (csh):
setenv INFORMIXDIR /opt/informix
setenv INFORMIXSQLHOSTS /opt/informix/etc/sqlhosts
setenv ONCONFIG onconfig
setenv INFORMIXSERVER myserver
setenv SERVERNUM 1
setenv PATH $INFORMIXDIR/bin:.:$PATH
2. Add your server to the sqlhosts file. The sqlhosts file is found in /opt/informix/etc. You must
add the INFORMIXSERVER name given above in the environment variables to the sqlhosts
file. The added line in sqlhosts should follow this format: dbservername nettype hostname servicename
[options]
The port given must also be open on your system. In this example, it was opened in the
/etc/services file. Here is an example of the line added to the services file:
port_alias 8201/tcp
4 of 12 20/01/11 12:25
A step-by-step how-to guide to install, configure, an... http://www.ibm.com/developerworks/data/library/...
3. Create the onconfig file. The onconfig file must be in the /opt/informix/etc directory. There
should already be a standard onconfig file there named onconfig.std. The contents below fit
the system needs for this example. You may need to add extra variables or you may not need
all of the variables shown below. The onconfig file contains the following contents:
DBSERVERNAME myserver
DUMPDIR /tmp
LOGDIR /opt/informix/logdir
MSGPATH /opt/informix/logdir/online.log
PHYSDBS rootdbs
ROOTNAME rootdbs
ROOTPATH /opt/informix/logdir/rootdbs
ROOTSIZE 30000
The DBSERVERNAME refers to the unique name associated with this specific database
server instance. The DUMPDIR refers to the directory in which the server dumps shared
memory and messages. The LOGDIR is the log directory for the IDS instance. The MSGPATH
is the full path name of the message log file. The PHYSDBS is the name of the dbspce that
contains the physical log. The ROOTNAME is the name for the root dbspace. The
ROOTPATH is the full path name of the initial chunk of the root dbspace. The ROOTSIZE is
the size of the initial chunk of the root dbspace.
4. Add the above specified log directory and root space. For the setup in this example, the
following was done:
su informix mkdir /opt/informix/logdir
su informix chmod 777 /opt/informix/logdir
cd /opt/informix/logdir
su informix touch rootdbs
su informix chmod 660 rootdbs
su root chown informix.root rootdbs
c. If you see "shared memory not initialized for INFORMIXSERVER 'myserver'", then the setup did not
work. However, if you see the something similar to "IBM Informix Dynamic Server Version
10.00.UC4 -- On-Line -- Up 00:00:07 -- 19508 Kbytes", then everything is up and working.
If you would later like to bring the server down, then the following command can be
issued:
onmode -kuy
5 of 12 20/01/11 12:25
A step-by-step how-to guide to install, configure, an... http://www.ibm.com/developerworks/data/library/...
For any issues with the Informix Dynamic Server, refer to the IBM Informix Dynamic Server
v10.0 Information Center for troubleshooting help.
Follow the steps below to install Apache with support for dynamically loaded modules:
cd /usr/local/src/httpd-2.2.0/
./configure \
--prefix=/usr/local/apache \
--enable-shared=max \
--enable-module=rewrite \
--enable-module=so
make
make install
1. Edit the http.conf file to process .php files correctly. The httpd.conf file can be found in
/usr/local/apache/conf/httpd.conf. Look for the following lines: #AddType application/x-httpd-php .php
#AddType application/x-httpd-php-source .phps
2. Remove the #s from the beginning of these lines if they are found. If they are not in the file,
then add them without the #s. This enables Apache to process and display php files
correctly.
3. You can more fully configure your Apache server by editing the httpd.conf file in /usr/local
/apache/conf. There is a great deal of documentation on the Internet about this topic.
./buildconf --force
./configure --with-apxs2=/usr/local/apache/bin/apxs \
--disable-debug \
--disable-ftp \
--disable-inline-optimization \
--disable-magic-quotes \
--disable-mbstring \
--enable-wddx=shared \
--enable-xml \
--with-dom \
--with-regex=system \
--with-xml \
6 of 12 20/01/11 12:25
A step-by-step how-to guide to install, configure, an... http://www.ibm.com/developerworks/data/library/...
--with-jpeg-dir=/usr/lib \
--with-zlib-dir=/usr/lib \
--with-zlib \
--without-pdo-sqlite \
--without-iconv \
--without-sqlite \
--enable-shared \
--enable-pdo \
--with-pdo-informix=/opt/informix
make
make install
cp php.ini-dist /usr/local/lib/php.ini
3. You can now see if the PHP install went as planned. You can issue the following command:
php -m
4. The output from this command should include both the PDO and the pdo_informix modules.
If those are not included, then the buildconf, configure, make, or the make install commands did not
go as planned.
There is the option to configure pdo_informix at a different time than PHP itself.
5. You can compile pdo_informix by itself, but it requires phpize from the installation location
of PHP. You do not need to perform this step if you configured or compiled
pdo_informix while configuring or compiling PHP.
cd pdo_informix
phpize
./configure
make
6. Add the correct extensions to the php.ini file. It is found at /usr/local/lib/php.ini. The
loadable extensions directory is specified inside the php.ini file. It is most commonly found
after the line: ; Directory in which the loadable extensions (modules) reside.
The other change needed in the php.ini file is the definition of the PDO and pdo_informix
extensions. They are found in the Dynamic Extensions section in php.ini. If they were created as
shared modules, you need to copy the modules into the above extension directory and enable
them in the php.ini file as shown below:
extension=pdo.so
extension=pdo_informix.so
7 of 12 20/01/11 12:25
A step-by-step how-to guide to install, configure, an... http://www.ibm.com/developerworks/data/library/...
To test the New Dynamic Web server, complete the following steps:
Open up your favorite browser and type localhost into the address bar. The default Apache
start page should show. This confirms that Apache has been started.
2. Make sure that PHP is working with Apache. You need to edit the index.html file that is
being displayed in your browser. This corresponds to where you installed Apache. The
location used for this example is here: /usr/local/apache/htdocs/index.html.
Erase the index.html file and replace it with the following (named index.php):
<html>
<body>
<?php
echo "PHP and Apache are playing nicely!";
?>
</body>
</html>
Then when you open up the page modified (http://localhost/index.php), you should see PHP and
Apache are playing nicely!.
If you see the PHP code itself , then your PHP and Apache installation
or configuration is flawed.
3. Make sure Informix is running and there is information you can query. In order to see if
Informix is running, do the following:
ps -aef | grep oninit
If any processes are found, then Informix is running. If not, start Informix with the command
given above. The tool Informix uses is dbaccess to create or delete databases, create or
delete tables, and insert or delete data. You can run dbaccess from:
/opt/informix/bin/dbaccess
a. Add users that need access to the 'informix'.sysauth table in the sysuser database.
b. Add a new database and table with data in it to test your server's setup.
There is documentation on the Internet if you are not familiar with dbaccess.
8 of 12 20/01/11 12:25
A step-by-step how-to guide to install, configure, an... http://www.ibm.com/developerworks/data/library/...
4. Check to make sure your PHP and PDO Informix setup is working correctly. You should go to
your default Apache document location (/usr/local/apache/htdocs) to add a test.php file. The
following is the contents of the test.php file (explained below):
<?php
?>
The variables in the connection string fit our system's needs. Choose the variables and their
values to fit your system and environment. The first line is the connection string for the
Informix database. The informix: is needed to start the connection string. The host is simply
the server host name. The service is the port number opened for your database
(/etc/services). The database is the name of the database you created above. The server is
the name of the database instance you created earlier. The protocol type is the protocol you
entered in the /etc/sqlhosts file. The rest of the options are self explanatory. The last two
options to the PDO object is the username and the password. Be sure that the user has been
added to the sysuser database as explained above.
When you open the Web page of test.php you should see Connection Established! and Table Contents
followed by the entity contents you added to your table.
Resources
Learn
Red Hat Enterprise Linux Documentation: Find information regarding Red Hat Enterprise
Linux.
IBM Informix Dynamic Server V10.0 Information Center: Get troubleshooting help for the
IBM Informix Dynamic Server V10.0.
9 of 12 20/01/11 12:25
A step-by-step how-to guide to install, configure, an... http://www.ibm.com/developerworks/data/library/...
developerWorks Information Management zone: Learn more about DB2. Find technical
documentation, how-to articles, education, downloads, product information, and more.
Informix product family : Find out how to get Informix product downloads.
Apache HTTP Server Project downloads: Get Apache HTTP Server Project downloads.
Build your next development project with IBM trial software, available for download directly
from developerWorks.
Discuss
Kellen Bombardier is a software engineer for IBM and a developer on the Information
Management team.
Close [x]
developerWorks: Sign in
If you do not have an IBM ID and password, register here.
IBM ID:
Forgot your IBM ID?
Password:
Forgot your password?
Change your password?
10 of 12 20/01/11 12:25
A step-by-step how-to guide to install, configure, an... http://www.ibm.com/developerworks/data/library/...
Submit Cancel
The first time you sign into developerWorks, a My developerWorks profile is created for you. This
profile includes the first name, last name, and display name contained in the profile you created
when you registered with My developerWorks. Selected information in your My developerWorks
profile is displayed to the public, but you may edit the information at any time. Your first name,
last name (unless you choose to hide them), and display name will accompany the content that
you post.
Close [x]
Note: Please choose a display name between 3-31 characters. Your display name must be unique
in the developerWorks community and should not be your email for privacy reasons.
Submit Cancel
1 star 1 star
2 stars 2 stars
3 stars 3 stars
4 stars 4 stars
5 stars 5 stars
Submit
Add comment:
11 of 12 20/01/11 12:25
A step-by-step how-to guide to install, configure, an... http://www.ibm.com/developerworks/data/library/...
Post
To update it for 2010: I used php 5.3.3, apache 2.2.16, PDO 1.2.6
(just substitute these version numbers into the URLs provided in the article)
Report abuse
so, where I can get a usable php_pdo_informix for php 5.2.x or php 5.3.x ?
I only to use a IBM open admin tool for informix. soo difficulty. I work at this test 2 days!
Report abuse
12 of 12 20/01/11 12:25