I have a PHP script in which I need to execute a shell script 'add_article.sh' that reads the parameters file and adds the contents of the news article to the search index (Lemur / Indri).
Running the 'add_article.sh' script myself (from the shell) works fine, but runs it from a php script, I get the following:
$blah = exec("./add_article.sh", $out, $ret_val);
echo $out . "<BR />";
echo $ret_val . "<BR />";
It creates
<i> Array>
<i> 255
It is in the correct directory and does not work even with an absolute path. I use the exact same format in another function in the same file that executes another script in the same directory, and everything is fine.
Any ideas?
source
share