在Mac OSX中通过php在终端执行命令
问题描述:
我想通过php在mac终端中执行命令。
如何做到这一点。
我做的是,
创建php文件
a.php
i want to execute command in terminal in mac via php.
how to do this.
What i did is,
create php file
a.php
$output = shell_exec('/Applications/XAMPP/xamppfiles/htdocs/chat/phpchat/abc.sh');
echo "<pre>$output</pre>";
和其他文件abc.sh
node complete / step6 / server.js
但它不起作用
and other file abc.sh
node complete/step6/server.js
but it doesn't works
答
output = shell_exec('/ Applications / XAMPP / xamppfiles /htdocs/chat/phpchat/abc.sh');
echo< pre >
output = shell_exec('/Applications/XAMPP/xamppfiles/htdocs/chat/phpchat/abc.sh'); echo "<pre>
output < / pre > ;
output</pre>";
和其他文件abc.sh
节点完成/ step6 / server.js
但它不起作用
and other file abc.sh
node complete/step6/server.js
but it doesn't works