how to run python api from php

3 次查看(过去 30 天)
Brenden Garrison
Brenden Garrison 2016-9-11
评论: Bo Li 2016-9-13
I'm using a PHP to call a python script that uses the matlab API. The engine.start_matlab() function won't execute.
I found this and was wondering if it means that my computer is considered a remote machine. I'm doing all of this on localhost, so I wouldn't have thought that this would be a problem.

回答(1 个)

Bo Li
Bo Li 2016-9-12
What is the error message? Which platform? Does it work outside of PHP?
If it works outside of PHP, the issue can be related to the conflict of libraries used by PHP and Python Engine.
  2 个评论
Brenden Garrison
Brenden Garrison 2016-9-12
There is no error message, the PHP page is just blank.
The python script does work outside of PHP. It successfully runs the matlab engine and produces the desired output.
Which libraries are used by PHP? I'm not sure how they would conflict because I'm using PHP's shell_exec function which just runs a terminal command.
Thank you.
Bo Li
Bo Li 2016-9-13
To find more details about this failure, you might need to check the log of the web server that invokes this PHP script.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 MATLAB Compiler SDK 的更多信息

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by