You are here: Re: exec stopped working? « PHP Programming Language « IT news, forums, messages
Re: exec stopped working?

Posted by shimmyshack on 04/30/07 19:02

On Apr 30, 5:36 pm, rickcasey <caseyr...@gmail.com> wrote:
> 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

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.

 

Navigation:

[Reply to this 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

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