exec stopped working?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
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 ".

    $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</
    echo "<input type='button' onClick='location.href=\"selectProject.php
\"' value='Select Projects' class='btn'>&nbsp;";
    echo "<button onClick='location.href=\"logout.php\"'><button>Logout</
    echo "<pre>";
    // Now execute the PHP function that runs an external program and
capture the output
    // in an array.
    if ($rtnvar) {
        foreach ($output as $var) {
            if ( (strcmp("seen before!!",$var)==0) || (strpos($var,"CALLS")>0))
            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,

Re: exec stopped working?

Quoted text here. Click to load it

I dont believe nothing has changed!
functions can be prevented from being used in the php.ini using
disable_functions = exec
for instance.

When you say stopped working, does it just not return anything, is it
the call to exec which is not happening or the output from your
script. Try using &2>1 to redirection the errors

Is there no chance of using passthru or system instead?

has there been any system wide security changes? has the kernel on the
machine change over to secure Linux,
are there simply no errors outputted form the php script at all?

Thats all I have right now.

Site Timeline