简体   繁体   中英

Using Linux to execute a query from Windows server by ODBC connection

Here is the problem: We have a client that uses Progress Openedge database, we need to execute queries on this database from our servers.

Currently the drivers are installed on our Windows server, and the PHP code uses ODBC to run the queries.

Now we would like to move the code to a Linux server. We tried before to work with their linux drivers but that attempt has failed.

The question is, Is it possible somehow to run PHP code on a linux server, this code communicates with the Windows server, runs the query on the Windows server, and return the results to Linux?

How would you access to this problem.

Thanks!

Yes, it's possible. Your question boils down to "how can my Linux server ask my Windows server to do something" (where the "something" happens to be "talk to a database"), and there are a variety of ways to accomplish that. You could run a web service (RESTful or SOAP) on the Windows server, for example.

Make sure you think about security: if you deploy a service on your Windows server that lets remote clients modify a database, you have to be mindful of which remote clients are allowed to use that service. The last thing you want to do is accidentally allow random strangers to run arbitrary queries against your database .

We have a Knowledgebase Article detailing some setup procedures for Linux installations; it also has a video explaining some aspects of the setup. If the other answered haven't provided a complete solution for you, hopefully our article can at least get you started in the right direction.

Also keep in mind that depending on your version of OE, the driver libraries may be different.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM