Reply to exec stopped working?

Your name:

Reply:


Posted by rickcasey on 04/30/07 16:36

I wonder if anyone has experienced something like this, as it seems
truly bizarre and is causing me to tear out my hair (what little there
is left of it)....

The exec() function just suddenly stopped working, for no discernable
reason. Here is the code:

$execdir = $homedirectory."/".$genename."/".$rundir;

// Run the Python script on the Exported text file(s).
$cmd = "/home/ehringer/MAELab/bin/Parse_AD_Output.py --FinalCall ".
$execdir;

$debug = 0;
if ($debug) {
echo "<br> cmd = ".$cmd."<br>";
}

echo "<h3>Difference Report for Project: ".
$projectname."&nbsp;&nbsp;&nbsp;&nbsp;Gene: ".
$genename."&nbsp;&nbsp;&nbsp;&nbsp;SNP: ".$snpname."</h3>";
// echo the selected filenames here as a record:
echo "<h4>Files compared in this run:<br>";
foreach ($filename_arr as $file) {
echo $file."<br>";
}
echo "</h4>";
echo "<button onclick=\"location.href='saveTempDiff.php?cmd=".
$cmd."'\" >Save As Temp Comparison File</button>&nbsp;";
echo "<button onclick=\"location.href='saveFinalDiff.php?cmd=".
$cmd."&gene=".$genename."&snp=".$snpname."'\" >Make Final Calls</
button>&nbsp;";
echo "<input type='button' onClick='location.href=\"selectProject.php
\"' value='Select Projects' class='btn'>&nbsp;";
echo "<button onClick='location.href=\"logout.php\"'><button>Logout</
button><br>";
echo "<pre>";
// Now execute the PHP function that runs an external program and
capture the output
// in an array.
exec($cmd,$output,$rtnvar);
if ($rtnvar) {
foreach ($output as $var) {
if ( (strcmp("seen before!!",$var)==0) || (strpos($var,"CALLS")>0))
{
continue;
}
echo $var."<br>";
}
} else {
echo "<h3>Execution of Parse_AD_Output failed!</h3><br>";
}
echo "</pre>";
?>


If I set debug true, and output the cmd variable, I can cut-&-paste
the cmd, and it executes fine at the command line in the target
directory. (The command is a Python script that takes as input all
files in the target directory.)

This was working fine for weeks. My sysadmin says nothing has changed
in the webserver or php installation.

If anyone has *any* insights as to why exec() would just stop working,
*please* respond here; this is holding up a critical project!

Thanks much,
Rick

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация