title: How to implement Matlab and WAMP with SQL for cross application requests?
body: <p>Two servers are implied here :
  One SQL server, One Windows server (hosting a wamp server and matlab)</p>
  
  <p>My purpose:</p>
  
  <ol>
  <li><p>Passing arguments to the matlab server ( Apache->Batch )</p>
  
  <ol>
  <li>Calling a webpage with arguments that triggers a batch script with
  these arguments. (PHP with exec, Apache)</li>
  <li>The Batch script starts matlab with these arguments.</li>
  </ol></li>
  <li><p>Matlab process ( Batch->Matlab(&lt;-SQL) )</p>
  
  <ol>
  <li><em>Retrieving data from a SQL server to a matlab server.</em></li>
  <li>Processing machine learning algorithms.</li>
  </ol></li>
  </ol>
  
  <p>The issue:</p>
  
  <p>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.</p>
  
  <p>When I start the batch file through the windows cmd, the SQL statements works fine in matlab.</p>
  
  <p>I tried "set_time_limit(0);" in the php script (no time limit) because the matlab script takes some time. Did not work.</p>
  
  <p>What would really helped me:</p>
  
  <ul>
  <li>Finding a way of launching Wamp/Apache then Matlab with other rights/user</li>
  <li>Finding a way of retrieving the matlab error and storing it into a file when launched from the server.</li>
  <li>Any pointer...</li>
  </ul>
  
  <p>Many thanks!</p>