PHP and SWI-Prolog

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
SmokOO
Forum Newbie
Posts: 2
Joined: Wed Feb 03, 2010 11:48 am

PHP and SWI-Prolog

Post by SmokOO »

Hi!

I'm trying to launch SWI-Prolog in php by using exec() function... and with no results. Here's how it looks:

prolog file test.pl

Code: Select all

test :- write('Test complete').
and php code:

Code: Select all

exec('c:\\Program Files\\prolog\\bin\\plwin -L128k -G128k -T128k -A128k -f c:\\Program Files\\prolog\\files\\test.pl -g test,halt', $result2);
print_r($result2);
"-L128k -G128k -T128k -A128k" are memory settings for prolog (they are not necessary)
"-g test,halt" executing 'test' predicate and stopping

as a result i get " Array() "

Thx for any help!
User avatar
AbraCadaver
DevNet Master
Posts: 2572
Joined: Mon Feb 24, 2003 10:12 am
Location: The Republic of Texas
Contact:

Re: PHP and SWI-Prolog

Post by AbraCadaver »

It been a while since I used windows so you may have to try different combinations, but the problem most likely is the spaces in your paths. Try something like this:

Code: Select all

exec('"c:\\Program Files\\prolog\\bin\\plwin" -L128k -G128k -T128k -A128k -f "c:\\Program Files\\prolog\\files\\test.pl" -g test,halt', $result2);
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
SmokOO
Forum Newbie
Posts: 2
Joined: Wed Feb 03, 2010 11:48 am

Re: PHP and SWI-Prolog

Post by SmokOO »

tried it, still the same result :/
Post Reply