【发布时间】:2015-04-20 11:01:25
【问题描述】:
我正在尝试从 PHP 执行一个 swi-prolog 文件,但是当我尝试运行此代码时,没有执行任何操作。这是我的代码:
<HTML>
<HEAD>
<TITLE>Calling SWI-Prolog from PHP (short)</TITLE>
</HEAD>
<body>
<H1>Calling SWI-Prolog from PHP (short)</H1>
<?
$cmd = "nice -n15 /C:/Program Files/swipl/bin/swipl-win.exe -f test.pl -g test,halt";
?>
<P>
<PRE>
<?
system( $cmd );
echo "\n";
$output = exec( $cmd );
echo $output;
echo "\n";
exec( $cmd, $output );
print_r( $output );
echo "\n";
$output = shell_exec( $cmd );
echo $output;
echo "\n";
?>
</PRE>
</P>
</body>
</HTML>
当我从我的服务器运行 php 文件时,它只显示字符串 Calling SWI-Prolog from PHP (short)。
【问题讨论】:
标签: php prolog swi-prolog