从PHP调用MATLAB可执行文件

I am trying call an executable of MATLAB code from PHP. Within MATLAB code I used fprintf(1, '123 456') to export result. This works when I run my MATLAB executable in console, but I cannot get results in PHP call $rt = exec('myMatlabCode.exe', $result). PHP $result is empty. Does anyone have some clue? Thanks.

exec is usually in the disabled functions list. check your php.ini

http://uk1.php.net/manual/en/ini.core.php#ini.disable-functions

http://uk1.php.net/function.exec

Theres also another parameter at the end, Have a look at the value of that