I am trying to use Scilab through PHP on my server like described in this document.
I am running Ubuntu 16.04. I have an Apache server running. I installed Scilab with apt-get install scilab
. I can successfully write scilab code like:
scilab -nwni -nb -e "m=[1 2 3; 3 4 5];disp(m);exit"
So now I am trying to execute it from PHP. I tried the examples in the document. For instance:
<?php
exec('scilab -nwni -nb -e "m=[1 2 3; 3 4 5];disp(m);exit;"', $output);
print_r($output);
?>
But I always get:
Error: Impossible to define SCIHOME environment variable.
SCIHOME not defined.
I don't know what I am doing wrong and how to fix it...
Any help would be greatly appreciated !