Lilley
Lilley

Reputation: 234

How to implement Matlab and WAMP with SQL for cross application requests?

Two servers are implied here : One SQL server, One Windows server (hosting a wamp server and matlab)

My purpose:

  1. Passing arguments to the matlab server ( Apache->Batch )

    1. Calling a webpage with arguments that triggers a batch script with these arguments. (PHP with exec, Apache)
    2. The Batch script starts matlab with these arguments.
  2. Matlab process ( Batch->Matlab(<-SQL) )

    1. Retrieving data from a SQL server to a matlab server.
    2. Processing machine learning algorithms.

The issue:

When the webserver calls the batch file which calls the matlab job, matlab could not manage to retrieve data from the SQL server, and the webpage waits for the end of process forever.

When I start the batch file through the windows cmd, the SQL statements works fine in matlab.

I tried "set_time_limit(0);" in the php script (no time limit) because the matlab script takes some time. Did not work.

What would really helped me:

Many thanks!

Upvotes: 0

Views: 794

Answers (1)

Lilley
Lilley

Reputation: 234

I have figured it out. The php was actually fine. The only issue was with the ODBC link.

  • I had to build an ODBC link for System DSN.
  • Then to make wamp as a localservice (SYSTEM) of the machine.
  • In the end, I had to make sure that Matlab was using this link and connecting to the SQL db with the right credentials.

Upvotes: 0

Related Questions