Using minizinc on wampserver

37 Views Asked by At

I'm trying to display a schedule on my local web page using minizinc as soon as I press a submit button. To do this, I run minizinc from the command line using:

if (isset($_POST["submit"])) { $output = shell_exec('"C:\path...\minizinc.exe" file.mzn file.dzn 2>&1'); echo "<pre>$output</pre>"; }

However, the message I get on my localhost is "=====ERROR====="

I've done some tests, I don't encounter this kind of problem if I try to run a command like "hostname". What's more, my script alone runs fine in php alone (without going through wampserver) and on the command line. It's when I pass it under if(isset($_POST...) that it gives me problems. So on my localhost.

Have you ever encountered this problem? Would you have a solution?

Thank you in advance for your answers.

1

There are 1 best solutions below

0
On

=====ERROR===== is one of the MiniZinc status messages indicating a problem with the solving process. This can happen because the solver crashed (with or without other messages). For example, if the solver was unable to open the generated FlatZinc file. Or, what seems likely in this case, that the solver you are trying to use is not found.

The first option to see where the problem lies is to enable the -v flag, and display the output from stderr. This will include information about what solver executable is started, which flags are requested from the solver, and where the FlatZinc file is created.

You can also try using different solvers. For example, cbc and gecode_presolver are builtin to the MiniZinc binary, which might forgo problems with locating solvers.