I am running WAMP Server 2.5 (32-bit) with PHP 5.5.12 on a Windows 7 SP1 64-bit machine. I am running Matlab R2014b.
I am trying to execute Matlab via PHP.
The Matlab function phptest.m is as follow:
function phptest
% Open file
fid = fopen('success.txt', 'wt');
%Print a test string
fprintf(fid, 'Test matlab function');
% Close file
fclose(fid);
% Quit MATLAB
quit force
When I execute from the command prompt:
matlab -wait -nosplash -sd "C:\wamp\www\testMatlab" -logfile logfile.txt -r "phptest;"
the code runs without problems and the file 'sucess.txt' is created.
However, if I try to execute via a php file:
<?php
$testStr = 'matlab -wait -nosplash -sd "C:\wamp\www\testMatlab" -logfile logfile.txt -r "phptest;"';
exec($testStr);
echo("Done!");
?>
The logfile shows the following error:
Severe: Error checking out license
Any help would be appreciated.