If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > Informix remote connect with php

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-12-06, 04:44
jooman jooman is offline
Registered User
 
Join Date: Dec 2005
Posts: 5
Unhappy Informix remote connect with php

Hi,

I have an apache server with php on a windows xp machine and a Informix database installed on a Linux machine. With php I want to connect to the Informix database with ifx_connect(). Which settings are to be made for this? Particularly, I don't know where the ip-adress of the Linux machine is set on the windows machine. I hope anyone can help me.
Reply With Quote
  #2 (permalink)  
Old 01-13-06, 04:56
jooman jooman is offline
Registered User
 
Join Date: Dec 2005
Posts: 5
Unhappy Now I know which settings to make but it still doesn't work

On the Linux machine (server) and the Windows machine (client) I edited the etc/hosts and the etc/services files and inserted the values for both machines. In the sqlhosts file on the Linux machine I added a line with the onsoctcp connection type. On the windows machine I added an analogous value in the registry. When I connect with ifx_connect() it happens nothing and after 30 seconds there is a error message:

Warning: ifx_connect(): E [SQLSTATE=08 004 SQLCODE=-908] in ...
Fatal error: Maximum execution time of 30 seconds exceeded in ...

Does anyone know how to get this working?
Reply With Quote
  #3 (permalink)  
Old 01-13-06, 10:09
DJFlori DJFlori is offline
Registered User
 
Join Date: Apr 2005
Posts: 5
Hello jooman,

how is your ifx_connect() setup, so what is inside as parameters?

Maybe you can try to connect via TCP/IP between the Windows and the Linux machine?!

Rgds
Flori
Reply With Quote
  #4 (permalink)  
Old 01-16-06, 02:53
jooman jooman is offline
Registered User
 
Join Date: Dec 2005
Posts: 5
My ifx_connect() parameters are:

database='test@ifx_server';
user='informix';
passwd='********';

ifx_server is the name of the Informix server on the Linux machine. test is a database on this server.

And yes, I have a tcp/ip connection between the two machines. When I call ifx_connect() you can see packets from the windows machine arriving on the linux machine on the port I have defined in etc/services. I seems that all the connection parameters are correct but Informix doesn't establish a remote connection.
Reply With Quote
  #5 (permalink)  
Old 01-16-06, 05:13
jooman jooman is offline
Registered User
 
Join Date: Dec 2005
Posts: 5
The problem has been fixed. It seems that there was something wrong with the Informix database.

When I shut down the Informix Server and restarted with oninit there was an error with the shared memory initialization. I always had to call oninit -i to initialize the whole database. Then I could access the database with dbaccess.

Now I changed some parameters in the onconfig file and now I'm able to restart the database with oninit. Also, the remote connect with php works fine.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On