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.
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 ...
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.
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.