Call swi-proog from php

I am trying to call swi-prolog from a php script, for example:

exec("start plwin.exe -f C:\\path\\load.pl -g run_from_file.", $os1);
print_r($os1);

I see that the prolog window opens and corresponds to the file, but immediately exits the output state as 1. I am sure that it does not execute the predicate that I want to execute.

Is there any other way to call the prolog with the appropriate parameters and save the window openwithout automatically exiting?

UPDATE: I configured the env variables of the system to the path where the prolog is installed.

+2
source share
2 answers

This link seems to contain some useful information on how to do this.

http://www.j-paine.org/dobbs/prolog_from_php.html

0
source

http://www.j-paine.org/dobbs/prolog_from_php.html, . , swipl, :

$cmd = swipl -f /path/to/myfile.pl -g test,halt -t 'halt(1)';

: http://www.swi-prolog.org/pldoc/man?section=cmdline, 2.4.4

php , , myfile.pl.

, -.

0

All Articles