从 php 调用 swi-prolog
我正在尝试从 php 脚本中调用 swi-prolog,例如:
exec("start plwin.exe -f C:\\path\\load.pl -g run_from_file.", $os1);
print_r($os1);
我可以看到 prolog 窗口打开并遵守文件,但立即退出,显示退出状态为 1。我确信它没有执行我想要的谓词至 执行。
是否还有其他方法可以使用适当的参数调用序言并保持窗口打开而不自动退出?
更新:我将系统环境变量配置为安装 prolog 的路径。
I am trying to invoke swi-prolog from within a php script like :
exec("start plwin.exe -f C:\\path\\load.pl -g run_from_file.", $os1);
print_r($os1);
I can see that prolog window gets opened and complies the file, but immediately exits displaying an exit status as 1. I am sure that it is not executing the predicate I want to to execute.
Is there any other to invoke prolog with appropriate parameters and keep the window open
without automatically exiting?
UPDATE : I configured the system env variables to the path where prolog is installed.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
此链接似乎提供了一些有关完成此操作的不同方法的有用信息。
http://www.j-paine.org/dobbs/prolog_from_php.html
This link seems to have some helpful information about different ways that this can be done.
http://www.j-paine.org/dobbs/prolog_from_php.html
我还使用了 http://www.j-paine.org/dobbs/ 中的教程prolog_from_php.html ,它给了我一个空白屏幕。
要在使用 swipl 的服务器上运行 prolog 文件,我更改为:
我在这里找到了所有需要的信息: http://www.swi-prolog.org/pldoc/man?section=cmdline ,在第 2.4.4 节中
php 文件的其余部分与示例中相同,现在它真正从 myfile.pl 执行测试。
也许他可以帮助别人。
I have also used the tutorial from http://www.j-paine.org/dobbs/prolog_from_php.html , and it was giving me a blank screen.
To run prolog file on a server where swipl is used, I changed to:
I found all needed information here: http://www.swi-prolog.org/pldoc/man?section=cmdline , in section 2.4.4
The rest of the php file is the same as in the example, and now it really executes test from myfile.pl.
Maybe his can help somebody.