problem about php+informix
Posted in 1999
Topics: Installation, Setup & Upgrades, Error Codes & Troubleshooting, Server Administration, Platform-Specific Issues, Internationalization & Character Sets, Versions, Editions & End-of-Life
Hi,
I have a problem about connectting to informix in php script.
I installed php with "--with-informix=/informixdir" option.
But following code is not executed.
My server is sun sparc enterprise 450, solaris 2.6
webserer is apache 1.3.x
php's version is 3.0.12
Informix : IDS 7.3
The sql of below example produce right results in dbaccess.
Any help appreciated. Thanks.
(code)
<?php
printf("informix test<br>");
$conn_id = ifx_pconnect("stores7@moneyne","informix","informix");
$res_id = ifx_query("
select o.order_num, i.total_price
from orders o, items i
where o.order_num = i.order_num", $conn_id);
if (!$res_id) {
printf("Can't select orders : %s\\n<br>%s<br>\\n",
ifx_error(),
ifx_errormsg()) ;
die;
}
ifx_htmltbl_result($res_id, "border=1");
ifx_free_result($res_id);
ifx_close($conn_id);
?>
(result)
Warning: E [SQLSTATE=IX 001 SQLCODE=-1829] in
/usr1/jhyim/public_html/infor.php on line 4
informix test (E [SQLSTATE=IX 001 SQLCODE=-1829])(Unable to load locale
categories.)...
Warning: ifx_query : 0 (type -1) is not a Informix link index in
/usr1/jhyim/public_html/infor.php on line 13
Can't select orders : E [SQLSTATE=IX 001 SQLCODE=-1829]
Unable to load locale categories.
ÀÓÀçÇö wrote:
>
> Hi,
> I have a problem about connectting to informix in php script.
> I installed php with "--with-informix=/informixdir" option.
> But following code is not executed.
> My server is sun sparc enterprise 450, solaris 2.6
> webserer is apache 1.3.x
> php's version is 3.0.12
> Informix : IDS 7.3
> The sql of below example produce right results in dbaccess.
> Any help appreciated. Thanks.
>
> (code)
>
> <?php
[...snip...]
> ?>
>
> (result)
> Warning: E [SQLSTATE=IX 001 SQLCODE=-1829] in
> /usr1/jhyim/public_html/infor.php on line 4
> informix test (E [SQLSTATE=IX 001 SQLCODE=-1829])(Unable to load locale
> categories.)...
That means INFORMIXDIR is not set -- not an uncommon problem with
web servers. Always, always, always worry about environment in
web server software accessing databases. Check on SetEnv and PassEnv.
> Warning: ifx_query : 0 (type -1) is not a Informix link index in
> /usr1/jhyim/public_html/infor.php on line 13
> Can't select orders : E [SQLSTATE=IX 001 SQLCODE=-1829]
> Unable to load locale categories.
--
Jonathan Leffler (jleffler@informix.com, jleffler@earthlink.net)
Guardian of DBD::Informix v0.62 -- see http://www.perl.com/CPAN
#include <disclaimer.h>
In article <37FEC2B6.4AC0@earthlink.net>, jleffler@earthlink.net says... > '''''' wrote: > > > > Hi, > > I have a problem about connectting to informix in php script. > > I installed php with "--with-informix=/informixdir" option. Probably not the reason, as Jonathan described, but the manual at http://www.php.net/manual/ref.ifx.php3 say "configure --with_informix=yes" for 3.0.12. Since this depends on $INFORMIXDIR, it will fail if this is not set. BTW, I'm fighting Apache, JServ, and PHP. I can make Apache with JServ, and Apache with PHP, but not both. If I run this simple script, I can enable PHP, but lose JServ: WORKROOT=/usr/Apache-JServ WEBSERVER=$WORKROOT/webserver APACHESRC=$WORKROOT/apache_1.3.6 PHPDIR=$WORKROOT/php-3.0.12 JSERV_SRC=$WORKROOT/ApacheJServ-1.0 JDK_HOME=/usr/java/jdk117_v3 JSDK_HOME=/usr/java/JSDK2.0 mv $WEBSERVER/bin/httpd $WEBSERVER/webserver/bin/httpd_backup cd $APACHESRC ./configure --prefix=$WEBSERVER cd $PHPDIR ./configure --with_informix=yes --with-apache=$APACHESRC --enable-track- (from prev. line) vars make make install cd $APACHESRC ./configure --prefix=$WEBSERVER --activate- (from prev. line) module=src/modules/php3/libphp3.a make cp $APACHESRC/src/httpd $WEBSERVER/bin/httpd cd $PHPDIR cp php3.ini-dist /usr/local/lib/php3.ini I have tried combing Jonathan's script to build Apache with JServ but with no success. I already have everything installed, so I would appreciate if someone (...:-) can help me modify above script so that I can run it in existing installation, to enable BOTH JServ and PHP. Thanks, Andrej Falout