0% found this document useful (0 votes)
17 views5 pages

Install PDO INFORMIX On Linux (Centos)

This document provides a step-by-step guide for installing PDO_INFORMIX on CentOS, starting with creating a user and group for Informix, downloading the client SDK, and configuring environment variables. It details the commands needed to download, compile, and install the PDO_INFORMIX module, as well as necessary configurations in various system files. Additionally, it includes troubleshooting tips for common connectivity issues related to environment variables and permissions.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views5 pages

Install PDO INFORMIX On Linux (Centos)

This document provides a step-by-step guide for installing PDO_INFORMIX on CentOS, starting with creating a user and group for Informix, downloading the client SDK, and configuring environment variables. It details the commands needed to download, compile, and install the PDO_INFORMIX module, as well as necessary configurations in various system files. Additionally, it includes troubleshooting tips for common connectivity issues related to environment variables and permissions.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Install PDO_INFORMIX on Linux (Centos)

PDO_INFORMIX INSTALLATION GUIDE ON CENTOS

• Create a group named informix


• Create a user with the same name (informix), who must belong to the informix group
Created in the previous step, this user's home directory must be /opt/IBM/informix.
Note that the user's home for informx is the path where the informix client will be installed.
(client sdk), that is, these must match.
• Download the clientsdk.2.90.UC4.tar from the IBM page, this is the client, and it
you can download from this route:
• download link
You must be registered with IBM in order to download it.
• Once you have it downloaded, you unzip it like this:

tar -xvf clientsdk.2.90.UC4.LINUX.tar

• Unzipped, you enter the folder clientsdk.2.90.UC4.LINUX.tar_FILES in the console and


You type./installclientsdky and follow the installer steps until completion.
• Note that in the client SDK installation it asks you to specify the path where you
the installation will show you /opt/IBM/informix by default, this path must correspond to
the user's informix home, created in the first step, you can change the path to
/opt/informix, but remember to update the home of the informix user so that it remains
just like, that is to say as: /opt/informix, or leave it as it shows you.

NOW CONTINUE TO INSTALL PDO_INFORMIX, follow these instructions:

Locate yourself in

any folder where you want the software to be downloaded, and type the following command:

• wgethttp://www.pecl.php.net/get/PDO_INFORMIX-1.0.0.tgz
• The previous command downloaded the PDO_IN file.
FORMIX-1.0.0.tgz, now you need to decompress it like this:
extract PDO_INFORMIX-1.0.0.tgz
• Now we need to compile the pdo_informix, for that we need the PHPIZE, to see if
it is installed, enter the pdo_informix folder (cd
(pdo_informix) and just type phpize, if it indicates that it's not installed, then
you need to install the development tools, with the following command:
yum install php-devel

Restart your Linux

• Now yes, let's compile the pdo_informix, inside the pdo_informix folder, type the
following commands:
• phpize
• ./configure
• make
• make install
• Look for pdo_informix.so inside the modules folder of your current path, and
paste it in /usr/lib/php/modules (if it doesn't exist already).

Up to this point, we are supposed to have the software installed, we are missing the configuration of
environment variables, php, services, hosts, etc., the following must be done:
Environment variables:

PROFILE /etc/profile

Edit it and add the lines:


/opt/IBM/informix
export INFORMIXDIR
PATH=$PATH:$INFORMIXDIR/bin
exportPATH

PDO.INI (Located in /etc/php.d/pdo.ini), here we will define the informix extension.


Add the following line:

extension=pdo_informix.so

SERVICES (Located in /etc/services)


Edit it and add at the end the lines, these are examples, add the ones that correspond to your
configuration:

Local services

aplicaexec 1526/tcp
sqlexec2 1527/tcp

SQLHOSTS (Located in opt/IBM/informix/etc/sqlhosts)

Edit it and add the following configuration:

instanceNameOnOctTcpIpOfYourSqlServerEc2
instance name on TCP/IP of your application server exec

instance name, is the name of the instance you will connect to in Informix.
onsoctcp is the protocol
sqlexec2 is the name of the service in linux (/etc/services)

HTTP Located in (etc/init.d/httpd)


Edit it and add the following lines:

INFORMIXDIR=/opt/IBM/informix export INFORMIXDIR


es_es.8859-1
In my case, I added them at the end, but it didn't recognize them, then I moved them to the first lines.
and he already recognized them perfectly.
CONFIGURATION VERIFICATION
Let's check that the pdo_informix module has been loaded

for this you can create a file with the following content:

nano configuration.php

phpinfo();
?>

Run it from a browser and look for the PDO section, it should appear like this:
PDO drivers => informix, mysql, odbc, sqlite

pdo_informix

enabled
In the Environment section, the environment variable INFORMIXDIR should appear like this:

Environment Section

It should show you the environment variable of INFORMIXDIR

/opt/IBM/informix

This info was obtained with phpinfo();


If all this appears to you, then it means that your pdo_informix module is already installed and done.
You can connect with PHP.

THROUBLESHOOTING
Lastly, keep this in mind, as if it fails to connect, it will commonly display the error:

Example 5-20 INFORMIXDIR environment variable not set


/usr/local/bin/php pdoconnect.php
Error!: SQLSTATE=HY000, SQLDriverConnect: -23101
Unspecified System Error = -23101.

This error is due to differences in your configuration, take into account the
next text:

Troubleshooting
The ifx_* function set also relies on the correct settings in environment variables.
and the configuration file for Informix SDK, so there are several sources for
problems in the first attempt to connect to the Informix IDS database server. We
list some of the most common mistakes causing connectivity problems. You may
notice that the error message shows twice in the output of our examples. The
The first message comes from the connect function for which we did not disable the.
error display. The second one is from the error caption. For a detailed discussion
about error management, refer to Section 5.2.7, “Error handling” on page 311.
Environment variables for Informix products are necessary to enable the client to
find the database server. Example 5-23 and Example 5-24 show the error
messages when the environment for the client is set improperly. Here we used
the PHP command line utility to generate the output. The browser would
generate similar results.
Example 5-23 Missing INFORMIXDIR in the Apache environment
/usr/local/bin/php ifxconnect.php
Warning: ifx_connect(): E [SQLSTATE=IX 001 SQLCODE=-1829] in
/usr/local/apache2/htdocs/ifxconnect.php on line 3
Example 5-24 Missing INFORMIXSERVER in the Apache environment
/usr/local/bin/php ifxconnect.php
Warning: ifx_connect(): E [SQLSTATE=IX 000 SQLCODE=-25560] in
/usr/local/apache2/htdocs/ifx/connect/ifxconnect.php on line 3
Connect: Returncode E [SQLSTATE=IX 000 SQLCODE=-25560] -- Environment
The variable INFORMIXSERVER must be set.

After setting the right environment variables, we have to take into account that
we are working in a client-server architecture. So the user running the PHP script
has to be authenticated at the database server machine for using the server. In
Example 5-25, the connection is attempting to connect with the wrong password.
which will certainly generate an error message.
Example 5-25 User connection password is wrong
/usr/local/bin/php ifxconnect.php
Warning: ifx_connect(): E [SQLSTATE=IX 000 SQLCODE=-952] in
/usr/local/apache2/htdocs/ifx/connect/ifxconnect.php on line 3
Connect: Returncode E [SQLSTATE=IX 000 SQLCODE=-952] -- User
([email protected])'s password is not correct for the
database server.

Verify the following if all necessary Informix environment variables are set in the
Apache environment is verified with phpinfo() and you still receive an error.
message as shown below:
/usr/local/bin/php ifxconnect.php
/usr/local/bin/php: error while loading shared libraries: libifsql.so
cannot open shared object file: No such file or directory
1. Does the library exist? If not, check the installation.
2. Does the user informix have the authority to run /usr/local/bin/php
If not, check permissions in the installation directory.
Are there other users getting similar errors such as this?
In this case, check the permissions of the installation path. One of the
directories above the SDK installation directory may not have read
permissions for public. A typical scenario is the installation in the home
directory of the informix user in Red Hat. The home directories have
rwx------ as default permissions.

Bibliography :
• The provided text is a URL and cannot be translated.
• Developing PHP Applications for IBM Data Servers, on the page
(Book)

235. (RedBooks, you can get it on the IBM page or in


some place on the internet).

You might also like