dbTalk Databases Forums  

PHP and Informix?

comp.databases.informix comp.databases.informix


Discuss PHP and Informix? in the comp.databases.informix forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
rspitzmd
 
Posts: n/a

Default PHP and Informix? - 03-28-2011 , 10:47 AM






Dear Informixers,

it's been a long time since I've been active in this group. Our IDS
server is just running smoothly, so I didn't need assistance. But now
something new has come up:

We have a web application in_house that our department wants to
participate in. The application is running under PHP5 on a Linux
server.

This application now needs access to data in our IDS 11.50 server. I
have no PHP knowledge, and the developer of the application has no
Informix knowledge. So I'm looking for a HowTo to implement PHP access
to our data, but the search has been very frustrating.

There is a PDO_IBM driver available for which there is practically no
documentation available, at least as far as Informix acess is
concerned. It seems that this requires a DB2 client on the PHP machine
and DRDA on the IDS server, but I have never worked with DRDA and
would like to avoid that if possible. There is also a PDO_Informix
driver but that seems to be not actively supported any more and
doesn't run with current versions of PHP.

Does anyone hear have a successful connection from PHP to IDS 11.50
and can give me step-by-step instructions about how to implement this?

Regards, Richard

Reply With Quote
  #2  
Old   
Art Kagel
 
Posts: n/a

Default Re: PHP and Informix? - 03-28-2011 , 12:34 PM






You are correct, the PDO_Informix connection is not being developed going
forward and I have been told that the PDO_IBM is the better choice.
Enabling DRDA in Informix, for versions 11.10 and later, is easy. Just add
a line to your SQLHOSTS file that names the protocol drsoctcp or drtlitcp
(as appropriate to your platform) and include that connection name in the
DBSERVERALIASES list. For the client side, you can download the same IBM
driver that is used for DB2 and install that on the PCs that need access to
the database and configure a connection to the database server's drda alias.

Art

Art S. Kagel
Advanced DataTools (www.advancedatatools.com)
Blog: http://informix-myview.blogspot.com/

Disclaimer: Please keep in mind that my own opinions are my own opinions and
do not reflect on my employer, Advanced DataTools, the IIUG, nor any other
organization with which I am associated either explicitly, implicitly, or by
inference. Neither do those opinions reflect those of other individuals
affiliated with any entity with which I am affiliated nor those of the
entities themselves.



On Mon, Mar 28, 2011 at 11:47 AM, rspitzmd <
Richard.Spitz (AT) med (DOT) uni-muenchen.de> wrote:

Quote:
Dear Informixers,

it's been a long time since I've been active in this group. Our IDS
server is just running smoothly, so I didn't need assistance. But now
something new has come up:

We have a web application in_house that our department wants to
participate in. The application is running under PHP5 on a Linux
server.

This application now needs access to data in our IDS 11.50 server. I
have no PHP knowledge, and the developer of the application has no
Informix knowledge. So I'm looking for a HowTo to implement PHP access
to our data, but the search has been very frustrating.

There is a PDO_IBM driver available for which there is practically no
documentation available, at least as far as Informix acess is
concerned. It seems that this requires a DB2 client on the PHP machine
and DRDA on the IDS server, but I have never worked with DRDA and
would like to avoid that if possible. There is also a PDO_Informix
driver but that seems to be not actively supported any more and
doesn't run with current versions of PHP.

Does anyone hear have a successful connection from PHP to IDS 11.50
and can give me step-by-step instructions about how to implement this?

Regards, Richard
_______________________________________________
Informix-list mailing list
Informix-list (AT) iiug (DOT) org
http://www.iiug.org/mailman/listinfo/informix-list

Reply With Quote
  #3  
Old   
Kamenik, Aleksander
 
Posts: n/a

Default RE: PHP and Informix? - 03-29-2011 , 05:40 AM



Quote:
For the client side, you
can download the same IBM driver that is used for DB2 and install that
on the PCs that need access to the database and configure a connection

Hi Art,

Can you elaborate on that. We're running pdo_informix and looking into pdo_ibm makes sense. I tried to install it once but I understand it requires the DB2 client SDK? I wasn't able to get it then and aborted the attempt.

Is there any documentation?

Regards,

Aleksander Kamenik
System Administrator
Krediidiinfo AS
an Experian Company
Phone: +372 665 9649
Email: aleksander (AT) krediidiinfo (DOT) ee

Reply With Quote
  #4  
Old   
Christian Knappke
 
Posts: n/a

Default Re: PHP and Informix? - 03-29-2011 , 06:39 AM



Am 28.03.2011 17:47 schrieb rspitzmd:

[...]

Quote:
Does anyone hear have a successful connection from PHP to IDS 11.50
and can give me step-by-step instructions about how to implement this?
Hi Richard,

take a look at the Redbook "IBM Informix Developer's Handbook" at
<http://www.redbooks.ibm.com/redbooks/SG247884/wwhelp/wwhimpl/java/html/wwhelp.htm>.

There is a whole chapter on this subject.

HTH and best regards
Christian

Reply With Quote
  #5  
Old   
Art Kagel
 
Posts: n/a

Default Re: PHP and Informix? - 03-29-2011 , 06:45 AM



Check out this link:
http://publib.boulder.ibm.com/infoce...nn.doc/php.htm

The "db2 driver" is any of several packages. The link above notes that the
easiest to use is "IBM Data Server Driver for ODBC and CLI" found at:
https://www14.software.ibm.com/webap...wg-informixfpd
installation instructions are at:
http://publib.boulder.ibm.com/infoce...installcli.htm

Art

Art S. Kagel
Advanced DataTools (www.advancedatatools.com)
Blog: http://informix-myview.blogspot.com/

Disclaimer: Please keep in mind that my own opinions are my own opinions and
do not reflect on my employer, Advanced DataTools, the IIUG, nor any other
organization with which I am associated either explicitly, implicitly, or by
inference. Neither do those opinions reflect those of other individuals
affiliated with any entity with which I am affiliated nor those of the
entities themselves.



On Tue, Mar 29, 2011 at 6:40 AM, Kamenik, Aleksander <
aleksander.kamenik (AT) krediidiinfo (DOT) ee> wrote:

Quote:
For the client side, you
can download the same IBM driver that is used for DB2 and install that
on the PCs that need access to the database and configure a connection

Hi Art,

Can you elaborate on that. We're running pdo_informix and looking into
pdo_ibm makes sense. I tried to install it once but I understand it requires
the DB2 client SDK? I wasn't able to get it then and aborted the attempt.

Is there any documentation?

Regards,

Aleksander Kamenik
System Administrator
Krediidiinfo AS
an Experian Company
Phone: +372 665 9649
Email: aleksander (AT) krediidiinfo (DOT) ee
_______________________________________________
Informix-list mailing list
Informix-list (AT) iiug (DOT) org
http://www.iiug.org/mailman/listinfo/informix-list

Reply With Quote
  #6  
Old   
Kamenik, Aleksander
 
Posts: n/a

Default RE: PHP and Informix? - 03-30-2011 , 06:11 AM



Quote:
From: Art Kagel [mailto:art.kagel (AT) gmail (DOT) com]

Check out this link:

http://publib.boulder.ibm.com/infoce...nn.doc/php.htm

The "db2 driver" is any of several packages. The link above notes
that the easiest to use is "IBM Data Server Driver for ODBC and CLI"
found
at:

https://www14.software.ibm.com/webap...wg-informixfpd

installation instructions are at:

http://publib.boulder.ibm.com/infoce...installcli.htm

Thanks, this got me started.

The link you provided got me is the 9.5 version though. On a separate route through the corporate homepage hell I got the latest 9.7 version. It might be found here, if you're lucky:

http://www-01.ibm.com/software/data/.../download.html -> Data Server Client Packages (GA level) -> IBM Data Server Driver for ODBC and CLI (CLI Driver) -> Choose your platform and download.

Then, you download the latest fixpack. The reason for the GA download is that the fixpack does not contain the header files which you'll need to build pdo_ibm.

http://www-01.ibm.com/software/data/.../download.html -> Data Server Client Packages (latest fixpacks) -> Choose the latest version which matches with tha GA release and download the fixpack.

But even this is not enough. These fixpacks (at least for 32bit linux) use security32/plugin/IBM/client/IBMOSauthclient.so.1, which is linked against libdb2osse.so.1 which is NOT included. If you're trying to make an RPM package then rpm will complain that you don't have libdb2osse.so.1 installed. I don't know what it does or if it's actually required but why link against it then?

It is shipped with the DB2 Client (v9.7fp3a_linuxia32_client_conpe_t.tar.gz), which can be found on the same fixpack page. Choose Client instead of Cli and ODBC driver. You only need the latest fixpack. I couldn't figure out how to extract the .so without installing the package. But fortunately I had junk VM's lying around. From an installation there I copied the libdb2osse.so.1 file.

So to install this package, which is required by pdo_ibm, I have this script (from the install section of my rpm spec file):

## installdir is something like /opt/ibmclidriver mkdir -p %{buildroot}%{installdir} cd %{buildroot}%{installdir} ## extract the GA version, which includes the header files tar -zx --strip-components=2 -f %{_sourcedir}/ibm_data_server_driver_for_odbc_cli_32_linuxia32_v 97.tar.gz
## overwrite with the fixpack. Kind of an upgrade tar -zx --strip-components=2 -f %{_sourcedir}/v9.7fp3a_linuxia32_odbc_cli.tar.gz
## install the libdb2osse.so.1 library on the system mkdir -p %{buildroot}%{_libdir} cp %{_sourcedir}/libdb2osse.so.1 %{buildroot}%{_libdir} cd %{buildroot}%{_libdir} ln -s libdb2osse.so.1 libdb2osse.so

Now the pdo_ibm install is simple, provided you have the pdo header files installed, probably the php-devel package.

This is for SLES11SP1, but can be changed for any other distro:

%build
phpize
%configure --with-pdo-ibm=/opt/ibmclidriver make

%install
mkdir -p %{buildroot}%{extension_dir}
mkdir -p %{buildroot}%{php_module_conf_dir}
cp modules/%{module_name}.so %{buildroot}%{extension_dir} echo "extension=%{module_name}.so" > %{buildroot}%{php_module_conf_dir}/%{module_name}.ini

Hope this helps someone,

Aleksander Kamenik
System Administrator
Krediidiinfo AS
an Experian Company
Phone: +372 665 9649
Email: aleksander (AT) krediidiinfo (DOT) ee

Reply With Quote
  #7  
Old   
Kamenik, Aleksander
 
Posts: n/a

Default RE: PHP and Informix? - 03-30-2011 , 06:19 AM



Outlook just rocks my world.

Here's the script again with the correct linebreaks, I hope:

## installdir is something like /opt/ibmclidriver

mkdir -p %{buildroot}%{installdir}
cd %{buildroot}%{installdir}

## extract the GA version, which includes the header files

tar -zx --strip-components=2 -f %{_sourcedir}/ibm_data_server_driver_for_odbc_cli_32_linuxia32_v 97.tar.gz

## overwrite with the fixpack. Kind of an upgrade

tar -zx --strip-components=2 -f %{_sourcedir}/v9.7fp3a_linuxia32_odbc_cli.tar.gz

## install the libdb2osse.so.1 library on the system

mkdir -p %{buildroot}%{_libdir}
cp %{_sourcedir}/libdb2osse.so.1 %{buildroot}%{_libdir}
cd %{buildroot}%{_libdir}
ln -s libdb2osse.so.1 libdb2osse.so

Regards,

Aleksander Kamenik
System Administrator
Krediidiinfo AS
an Experian Company
Phone: +372 665 9649
Email: aleksander (AT) krediidiinfo (DOT) ee


Quote:
-----Original Message-----
From: informix-list-bounces (AT) iiug (DOT) org [mailto:informix-list-
bounces (AT) iiug (DOT) org] On Behalf Of Kamenik, Aleksander
Sent: Wednesday, March 30, 2011 2:12 PM
To: informix-list (AT) iiug (DOT) org
Subject: RE: PHP and Informix?

From: Art Kagel [mailto:art.kagel (AT) gmail (DOT) com]

Check out this link:


http://publib.boulder.ibm.com/infoce...ex.jsp?topic=/
com.ibm.conn.doc/php.htm

The "db2 driver" is any of several packages. The link above notes
that the easiest to use is "IBM Data Server Driver for ODBC and CLI"
found
at:


https://www14.software.ibm.com/webap...?lang=en_US&so
urce=swg-informixfpd

installation instructions are at:


http://publib.boulder.ibm.com/infoce...ex.jsp?topic=/
com.ibm.conn.doc/installcli.htm

Thanks, this got me started.

The link you provided got me is the 9.5 version though. On a separate
route through the corporate homepage hell I got the latest 9.7 version.
It might be found here, if you're lucky:

http://www-01.ibm.com/software/data/db2/linux-unix-
windows/download.html -> Data Server Client Packages (GA level) -> IBM
Data Server Driver for ODBC and CLI (CLI Driver) -> Choose your
platform and download.

Then, you download the latest fixpack. The reason for the GA download
is that the fixpack does not contain the header files which you'll need
to build pdo_ibm.

http://www-01.ibm.com/software/data/db2/linux-unix-
windows/download.html -> Data Server Client Packages (latest fixpacks)
-> Choose the latest version which matches with tha GA release and
download the fixpack.

But even this is not enough. These fixpacks (at least for 32bit linux)
use security32/plugin/IBM/client/IBMOSauthclient.so.1, which is linked
against libdb2osse.so.1 which is NOT included. If you're trying to make
an RPM package then rpm will complain that you don't have
libdb2osse.so.1 installed. I don't know what it does or if it's
actually required but why link against it then?

It is shipped with the DB2 Client
(v9.7fp3a_linuxia32_client_conpe_t.tar.gz), which can be found on the
same fixpack page. Choose Client instead of Cli and ODBC driver. You
only need the latest fixpack. I couldn't figure out how to extract the
.so without installing the package. But fortunately I had junk VM's
lying around. From an installation there I copied the libdb2osse.so.1
file.

So to install this package, which is required by pdo_ibm, I have this
script (from the install section of my rpm spec file):

## installdir is something like /opt/ibmclidriver mkdir -p
%{buildroot}%{installdir} cd %{buildroot}%{installdir} ## extract the
GA version, which includes the header files tar -zx --strip-
components=2 -f
%{_sourcedir}/ibm_data_server_driver_for_odbc_cli_32_linuxia32_v 97.tar.
gz
## overwrite with the fixpack. Kind of an upgrade tar -zx --strip-
components=2 -f %{_sourcedir}/v9.7fp3a_linuxia32_odbc_cli.tar.gz
## install the libdb2osse.so.1 library on the system mkdir -p
%{buildroot}%{_libdir} cp %{_sourcedir}/libdb2osse.so.1
%{buildroot}%{_libdir} cd %{buildroot}%{_libdir} ln -s libdb2osse.so.1
libdb2osse.so

Now the pdo_ibm install is simple, provided you have the pdo header
files installed, probably the php-devel package.

This is for SLES11SP1, but can be changed for any other distro:

%build
phpize
%configure --with-pdo-ibm=/opt/ibmclidriver make

%install
mkdir -p %{buildroot}%{extension_dir}
mkdir -p %{buildroot}%{php_module_conf_dir}
cp modules/%{module_name}.so %{buildroot}%{extension_dir} echo
"extension=%{module_name}.so" >
%{buildroot}%{php_module_conf_dir}/%{module_name}.ini

Hope this helps someone,

Aleksander Kamenik
System Administrator
Krediidiinfo AS
an Experian Company
Phone: +372 665 9649
Email: aleksander (AT) krediidiinfo (DOT) ee

_______________________________________________
Informix-list mailing list
Informix-list (AT) iiug (DOT) org
http://www.iiug.org/mailman/listinfo/informix-list

Reply With Quote
  #8  
Old   
rspitzmd
 
Posts: n/a

Default Re: PHP and Informix? - 04-02-2011 , 09:42 AM



On 30 Mrz., 13:11, "Kamenik, Aleksander"
<aleksander.kame... (AT) krediidiinfo (DOT) ee> wrote:
Quote:
Thanks, this got me started.
[ long odyssey through installation steps deleted... ]

This is what I meant. Why does IBM require potential users to go
through such an ordeal?

Thanks for any hints I got through this thread and via mail so far. So
far no success yet, but in my special
case this is not only IBM's fault, but also the complicatedness of the
target PHP system. It is a pre-configured
XAMPP server (32bit) running under SLES10 64bit, and even though the
admin of this system has been
very active trying to get it to run, we haven't got anywhere with the
PDO_IBM driver.

With the PDO_Informix driver, we are at least getting somewhere, but
there seems to be some quirk with
the INFORMIXSERVER environment variable. If it is NOT set when calling
the php test script, we get the
dreaded -23101 error. When it is set, we get error "Unable to load
translation shared library (DLL)".
Since I have very little insight into the PHP system, I haven't been
able to identify the problem. Any ideas?

Regards, Richard

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.