Jump to content


Photo

PHP-N-Ingres Configuration


  • Please log in to reply
4 replies to this topic

#1 ca2006

ca2006
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 19 December 2005 - 05:30 PM

Hi PHP Gurus, I am trying to get PHP working with INgres on IIS6.0. I downloaded PHP5.1.1 binary version and PECL library for Ingres support and confgured IIS6.0. I have the test PHP script <?php phpinfo() ?> working fine it displays all the PHP info. I have INgres-r3 installed and it is up and running.

Now my questions,

Question 1: Should I recompile PHP to get PHP-ingres extension (ingres_pconnect() ) working?

If I have to recompile what are the options required to recompile. I downloaded php 5.1.1 src also.


Question 2: I googled php-ingres support and found that PHP should be compiled with Ingres to get ingres working (NOT using ODBC). Please confirm this.

Just to try, I compiled php src with these options
cscript /nologo configure.js "--with-ingres=C:\opt\Ingres" "--without-iconv" "--disable-com-dotnet" "--without-gd" "--without-libxml"

It compiled fine and I do have the compiled version.

I have to sample scripts to test DB connection,

test1.php
<?php

$connectionstring = odbc_connect("MDB", "admin", "admin");

$Query = "SELECT table_name FROM iitables";

$queryexe = odbc_do($connectionstring, $Query);

odbc_result_all($queryexe, "BORDER=1");

odbc_close($connectionstring);

?>

test2.php
<?php

$connection = ingres_pconnect("MDB", "admin", "admin");

ingres_query("select table_name from iitables");
while ($row = ingres_fetch_row()) {
echo $row;
}
?>

test1.php is working fine with the PHP binary version I downloaded but does not work with the recompiled version. now the question is after I recompile should I copy any files from compiled version into the binary version or should I just use the new compiled version (I am currently setup to use the compiled version) If so what are the chnages required?

test2.php does not work on either versions, Here is the error I am running into

Fatal error: Call to undefined function ingres_pconnect() in C:\php\testpro\test2.php on line 6

I am struck on this for the past two days, I woud appreciate if anyone can anwser these questions.

Thank you.



#2 ca2006

ca2006
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 19 December 2005 - 06:41 PM

Ok, I read the readme doc it said to move .exe and .dlls to the working php dir. I did that now nothing is working. Fortunately I had the backup of the files I deleted, I restored them after that everything works fine. So, evedently something is worng with the build.

Would someone reply with a solution please.

Thank you.

#3 ca2006

ca2006
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 19 December 2005 - 07:55 PM

more info, I have used get_loaded_extensions() method to find the modules loaded, list is as below
Array (
[0] => bcmath
[1] => calendar
[2] => com_dotnet
[3] => ctype
[4] => date
[5] => ftp
[6] => iconv
[7] => odbc
[8] => pcre
[9] => session
[10] => libxml
[11] => standard
[12] => tokenizer
[13] => zlib
[14] => SimpleXML
[15] => dom
[16] => SPL
[17] => wddx
[18] => xml
[19] => ISAPI )
lib loading done - - 1 -

evidently ingres module is NOT LOADED, but when I trace it from command line php -m ig gives me a different list - It lists INGRES MODULE

C:\php>php -m
[PHP Modules]
bcmath
calendar
com_dotnet
ctype
date
dom
ftp
iconv
ingres
libxml
odbc
pcre
session
SimpleXML
SPL
standard
tokenizer
wddx
xml
zlib

[Zend Modules]

global shutdown

C:\php>

Would someone please explain what is going on; Your comments are really appreciated.

#4 ca2006

ca2006
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 19 December 2005 - 08:59 PM

Ok, I found the answer. for some reason php.ini file was not getting loaded when I started IIS server so I had to move the "php.ini" file to C:\Windows. That resolved it now my app loads ingres_pconnect() method.

#5 ing

ing
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 18 April 2006 - 09:19 AM





[!--quoteo(post=328737:date=Dec 19 2005, 12:30 PM:name=ca2006)--][div class=\'quotetop\']QUOTE(ca2006 @ Dec 19 2005, 12:30 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Hi PHP Gurus, I am trying to get PHP working with INgres on IIS6.0. I downloaded PHP5.1.1 binary version and PECL library for Ingres support and confgured IIS6.0. I have the test PHP script <?php phpinfo() ?> working fine it displays all the PHP info. I have INgres-r3 installed and it is up and running.

Now my questions,

Question 1: Should I recompile PHP to get PHP-ingres extension (ingres_pconnect() ) working?

If I have to recompile what are the options required to recompile. I downloaded php 5.1.1 src also.
Question 2: I googled php-ingres support and found that PHP should be compiled with Ingres to get ingres working (NOT using ODBC). Please confirm this.

Just to try, I compiled php src with these options
cscript /nologo configure.js "--with-ingres=C:\opt\Ingres" "--without-iconv" "--disable-com-dotnet" "--without-gd" "--without-libxml"

It compiled fine and I do have the compiled version.

I have to sample scripts to test DB connection,

test1.php
<?php

$connectionstring = odbc_connect("MDB", "admin", "admin");

$Query = "SELECT table_name FROM iitables";

$queryexe = odbc_do($connectionstring, $Query);

odbc_result_all($queryexe, "BORDER=1");

odbc_close($connectionstring);

?>

test2.php
<?php

$connection = ingres_pconnect("MDB", "admin", "admin");

ingres_query("select table_name from iitables");
while ($row = ingres_fetch_row()) {
echo $row;
}
?>

test1.php is working fine with the PHP binary version I downloaded but does not work with the recompiled version. now the question is after I recompile should I copy any files from compiled version into the binary version or should I just use the new compiled version (I am currently setup to use the compiled version) If so what are the chnages required?

test2.php does not work on either versions, Here is the error I am running into

Fatal error: Call to undefined function ingres_pconnect() in C:\php\testpro\test2.php on line 6

I am struck on this for the past two days, I woud appreciate if anyone can anwser these questions.

Thank you.
[/quote]


Am getting the same error too... can u please help me with the solution




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users