0

I have SWI Prolog working in my vm where I'm going to be working on a PHP/HTML website. I've been following this guide: http://www.j-paine.org/dobbs/prolog_from_php.html#appendix to set up my php file to receive the output from the executed prolog file. The problem that I'm having is that it seems that the output from SWI's command line (which I'm executing from my bash terminal) isn't being captured as a standard output that I can get PHP to recognize. So, in my terminal, when I execute SWI and a test prolog file, it writes out like I need it to, but I can't figure out how to capture that output to then use in PHP.

Any ideas or suggestions would be really great. Thanks!

  • 1
    maybe [proc_open](http://php.net/manual/it/function.proc-open.php) – CapelliC Sep 26 '14 at 18:06
  • What are you using at the command-line to connect the two processes? Pipes? Stream redirection? Consider updating your question with those details. – Paulo Moura Sep 26 '14 at 18:27
  • @PauloMoura - I'm not sure what pipes or stream redirections are, and perhaps my problem is that I'm not connecting the command-line with the two processes. The tutorial that I linked to in my original post makes it seem like as long as I run the system commands that the SWI output can be used with PHP without any additional steps, but it isn't working for me. –  Sep 27 '14 at 20:27
  • @CapelliC - I hadn't seen that before; I'll check it out –  Sep 27 '14 at 20:35
  • Update - I never could get it working in SWI, so I tried in GNU Prolog and it worked with "gprolog --init-goal '[test],test,halt'" –  Sep 30 '14 at 15:30

0 Answers0