Home > Backend Development > PHP Tutorial > PHP执行CMD命令解决方案

PHP执行CMD命令解决方案

WBOY
Release: 2016-06-13 12:19:52
Original
1312 people have browsed it

PHP执行CMD命令
如何在PHP中执行以下系统命令:
D:\MATLAB\R2012a\bin>matlab  -r MatrixCompute

我尝试用了以下代码:

<br /><?php<br />header ( "Content-type: text/html; charset=UTF-8" ); 	//设置文件编码格式<br />echo("打开matlab。。。");<br />exec("D:\MATLAB\R2012a\bin>matlab  -r MatrixCompute");<br />?><br />
Copy after login


结果只输出了:打开matlab。。。
系统没有打开matlab程序。

请问这是什么原因?(安全模式已关闭)
------解决思路----------------------
你命令都写错了!
D:\MATLAB\R2012a\bin\matlab  -r MatrixCompute

请注意:被 php 执行的外部命令是在后台运行的,不会出现用户界面,也无法响应用户交互
------解决思路----------------------
matlib是不是有工具输出c/cpp的code, 然后用php扩展包一层。
还有matlib应该可以开tcp服务吧,这样php与matlib之间走socket通讯就行了。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template