Ingres Community Forums Login Register Ingres.com  

Ingres Community Forum


Go Back   Ingres Community Forums > Ingres Forums > Database Drivers and APIs > PHP
 

Reply
 
LinkBack Thread Tools Display Modes
Old 2010-02-05   #1 (permalink)
Junior Member
 
Join Date: Jul 2009
Posts: 7
Unhappy how to connect php with ingres DB

Hi All,

Please help on this..
Im using a xampp package..
version 1.7.3 which runs on windows

And the ingres Db runs on solaris
INGRES TERMINAL MONITOR Copyright 2003 Ingres Corporation
Ingres SPARC SOLARIS Version II 2.6/0305 (su4.us5/00) login

I dont know how to establish a connection..
i think i need the php_ingres.dll cause its missing on php ext
and what else do i need
Please help

Regards,
obstruction is offline   Reply With Quote
Old 2010-02-05   #2 (permalink)
Ingres Dev - PHP + Ruby
 
grant's Avatar
 
Join Date: Mar 2007
Location: Valladolid, España
Posts: 464
Blog Entries: 1
Send a message via MSN to grant
Default

Hi obstruction,

Various php_ingres.dlls are provided on the Ingres download site, http://esd.ingres.com/product/driver...Bit/PHP_Driver. In order to connect to your Solaris server you will need to install an Ingres/NET client for Windows. If you have a contract with Ingres you can download the Server install package from http://esd.ingres.com/product/Ingres...Bit/Ingres_9.2, which also contains the NET part required. If you don't have a support contract then you can use one of our community releases, http://esd.ingres.com/product/Commun...ngres_Database.

Once you have Ingres/NET and the php_ingres.dll installed and running you can connect with the following PHP code:

Code:
$host = "solaris_hostname"; // the hostname or IP address of your Ingres 2.6 machine
$port = "II"; // The value for II_INSTALLATION on the solaris server
$user = "username"; // the user you want to connect as 
$pass = "password"; // password for $user
$database ="dbname"; // the database to connect to on the server

$url = "@".$host.",tcp_ip,".$port."[".$user.",".$pass."]::".$database;

$conn = ingres_connect($url);

$ingres_close($conn);
Hopefully this gets you started

regards

grant
grant is offline   Reply With Quote
Old 2010-02-07   #3 (permalink)
Junior Member
 
Join Date: Jul 2009
Posts: 7
Default

uhm.. i still get this "Fatal error: Call to undefined function ingres_connect()"

by the way.. is it possible to send a command to execute a script that is on the unix?
im trying to use this one but it doesn't really execute it..

<?php
$command = "myscript.sh";
$conn = ftp_connect("ftp.testftp.com") or die("Could not connect");
ftp_login($conn,"admin","ert456");

if (ftp_exec($conn,$command))
{
echo "Command executed successfully";
}
else
{
echo "Execution of command failed";
}

ftp_close($conn);
?>

Last edited by obstruction; 2010-02-07 at 05:47 AM.
obstruction is offline   Reply With Quote
Old 2010-02-07   #4 (permalink)
Ingres Dev - PHP + Ruby
 
grant's Avatar
 
Join Date: Mar 2007
Location: Valladolid, España
Posts: 464
Blog Entries: 1
Send a message via MSN to grant
Default

Quote:
Originally Posted by obstruction View Post
uhm.. i still get this "Fatal error: Call to undefined function ingres_connect()"
what does the output from
Code:
<?php phpinfo(); ?>
show? It looks like the DLL is not in the correct place, defined by extension_dir or there is an environment variable missing.

Quote:
Originally Posted by obstruction View Post
by the way.. is it possible to send a command to execute a script that is on the unix?
im trying to use this one but it doesn't really execute it..

<?php
$command = "myscript.sh";
$conn = ftp_connect("ftp.testftp.com") or die("Could not connect");
ftp_login($conn,"admin","ert456");

if (ftp_exec($conn,$command))
{
echo "Command executed successfully";
}
else
{
echo "Execution of command failed";
}

ftp_close($conn);
?>
I've never used the FTP extension for PHP but I would assume you can only run the commands accepted by the FTP server daemon. See the documentation at PHP: ftp_exec - Manual for more information.
grant is offline   Reply With Quote
Old 2010-02-09   #5 (permalink)
Ingres Community
 
dejan's Avatar
 
Join Date: Jun 2009
Location: London, UK
Posts: 158
Send a message via MSN to dejan Send a message via Yahoo to dejan
Default

If you got "Fatal error: Call to undefined function ingres_connect()", it means you did not install INGRES PHP module (the DLL file) properly. It is fairly simple, just follow instructions.
dejan is offline   Reply With Quote
Old 2010-03-27   #6 (permalink)
Junior Member
 
Join Date: Jul 2009
Posts: 7
Default

can you send me an instruction of installation

ang list of package that are compatible..
im using xampp for php since i did no have any problem with its setup on oracle..

thanks.
obstruction is offline   Reply With Quote
Old 2010-03-27   #7 (permalink)
Junior Member
 
Join Date: Jul 2009
Posts: 7
Default

im using xampp 1.7.3
and
ingres-9.3.1-104-eval-win-x86-Full

i got the ingres dll from ingres-2.2.1-x86-win32
are this not compatible?

obstruction is offline   Reply With Quote
Old 2010-03-27   #8 (permalink)
Junior Member
 
Join Date: Jul 2009
Posts: 7
Default

do you guys know where i can get this DLL

OICLFNT.DLL ???

obstruction is offline   Reply With Quote
Old 2010-03-28   #9 (permalink)
Ingres Community
 
dejan's Avatar
 
Join Date: Jun 2009
Location: London, UK
Posts: 158
Send a message via MSN to dejan Send a message via Yahoo to dejan
Post

You must check which version of PHP XAMPP contains, and download appropriate PHP-Ingres package.

As for the DLL you asked for... See, in order to connect to the Ingres database via PHP, you need a minimal installation of ingres (Ingres/NET component is enough for this). So, if you are connecting from Windows, you must download, and install Ingres/NET on that particular Windows machine.

Only Java JDBC driver, and perhaps .NET driver connect straight to the target DAS (Data Access Server).

If you wonder why is this - I suggest you read the documentation and learn about Ingres Architecture. It is not too complex.

In short:
Code:
[Windows machine  (Ingres  GCN GCC)]
                                 |
                                 |
[Solaris server (Ingres DBMS(es) GCC(s) GCN DMFACP DMFRCP)]
As you can see from above, two Ingres components (GCN - name server, GCC - communication server) are enough to connect to the Ingres installation on the Solaris server. Two GCCs are needed to make that communication possible. (Actually more is going on behind the scene, but this is enough to get the picture). So, on Windows, if you use PHP (and anything else that uses OpenAPI (C library)), you must install Ingres/NET in order to communicate with the Ingres installation on a remote server.
dejan is offline   Reply With Quote
Old 2010-03-29   #10 (permalink)
Ingres Corp
 
Join Date: Mar 2007
Location: On the OpenROAD
Posts: 828
Default

Quote:
Originally Posted by obstruction View Post
do you guys know where i can get this DLL

OICLFNT.DLL ???

OICLFNT.DLL is some DLL contained in an old (Ingres 2.6 or before) installation on Windows.
Where did you get this name from?
It won't be contained in an Ingres 9.2 client installation.
Bodo is offline   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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


© 2009 Ingres Corporation. All Rights Reserved