从Wamp服务器执行但不是命令提示符时,Matlab返回许可证检出错误(Matlab returns license checkout error when executed from Wamp se

编程入门 行业动态 更新时间:2024-10-17 07:31:45
从Wamp服务器执行但不是命令提示符时,Matlab返回许可证检出错误(Matlab returns license checkout error when executed from Wamp server but not command prompt)

我在Windows 7 SP1 64位计算机上运行WAMP Server 2.5(32位)和PHP 5.5.12。 我正在运行Matlab R2014b。

我试图通过PHP执行Matlab。

Matlab函数phptest.m如下:

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

当我从命令提示符执行时:

matlab -wait -nosplash -sd "C:\wamp\www\testMatlab" -logfile logfile.txt -r "phptest;"

代码运行没有问题,并创建文件'sucess.txt'。

但是,如果我尝试通过php文件执行:

<?php $testStr = 'matlab -wait -nosplash -sd "C:\wamp\www\testMatlab" -logfile logfile.txt -r "phptest;"'; exec($testStr); echo("Done!"); ?>

日志文件显示以下错误:

严重:检查许可证时出错

任何帮助,将不胜感激。

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.

最满意答案

您可以通过使用-c标志运行MATLAB来强制使用特定的许可证文件:

'matlab -c "path/to/license" -wait -nosplash -sd "C:\wamp\www\testMatlab" -logfile logfile.txt -r "phptest;"';

matlab -c licensefile使用指定的许可证文件启动MATLAB。 licensefile参数可以具有port @ host形式,也可以是以冒号分隔的许可证文件名列表。 此选项会导致忽略LM_LICENSE_FILE和MLM_LICENSE_FILE环境变量。

请参阅: http : //www.mathworks.nl/help/matlab/ref/matlabwindows.html

You can force MATLAB to use a specific license file by running it with the -c flag:

'matlab -c "path/to/license" -wait -nosplash -sd "C:\wamp\www\testMatlab" -logfile logfile.txt -r "phptest;"';

matlab -c licensefile starts MATLAB using the specified license file. The licensefile argument can have the form port@host or it can be a colon-separated list of license filenames. This option causes the LM_LICENSE_FILE and MLM_LICENSE_FILE environment variables to be ignored.

See: http://www.mathworks.nl/help/matlab/ref/matlabwindows.html

更多推荐

本文发布于:2023-08-07 07:23:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1462700.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:检出   命令提示符   许可证   错误   服务器

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!