Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to combine PHP and Prolog

I'm trying to call Prolog using a PHP script. I'm using the syntax I found here, which is:

$cmd = "nice -n15 /software/bin/pl -f /home/popx/cgi-bin/test.pl -g test,halt";

The program /bin/pl is where I have Prolog installed, and /home/popx/cgi-bin/test.pl is the location of the file to be consulted. After changing the paths accordingly, I get no output. Can someone help me, and give me some pointers?

I'm already conversant with the questions How to use Prolog with PHP?, and Invoking SWI-Prolog from PHP, but they do not answer my question.

like image 459
Erin Avatar asked Nov 06 '22 03:11

Erin


1 Answers

You cannot retrieve the output with system(). Use exec() instead.

http://docs.php.net/manual/en/function.exec.php

like image 114
rik Avatar answered Nov 12 '22 13:11

rik