<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-15">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<font face="Ubuntu">Dear,<br>
I have prepared a couple of scripts to execute a batch job: the
first opens a csv file and formats the data for the second
(invoked from the first) that include some grass functionality.<br>
The second script uses grass functionality without starting grass
explicitly.</font><br>
<font face="Ubuntu">If I execute the first script from shell all it
is working, but if i invoke it from a php button
(shell_exec('python path/script.py')) I receive the error: </font><font
face="Ubuntu"><i>Cannot find GRASS GIS 7 start script (['grass72',
'--config', 'path'])</i><br>
I saw that it is related to subprocess (here the code):<br>
<br>
<i>p = subprocess.Popen(startcmd,
shell=False,stdout=subprocess.PIPE, stderr=subprocess.PIPE)</i><i><br>
</i><i>out, err = p.communicate()</i><i><br>
</i><i>if p.returncode != 0:</i><i><br>
</i><i> print >>sys.stderr, "ERROR: Cannot find GRASS GIS
7 start script (%s)" % startcmd</i><i><br>
</i><i> sys.exit(-1)</i><i><br>
</i><i>gisbase = out.strip('\n\r')</i><br>
<br>
but I am not expert about this, so I ask for your help.<br>
What could I do?<br>
I have already set sudoers www-data ALL=NOPASSWD: ALL and
checked permission.<br>
Thanks in advance<br>
<br>
carmine<br>
</font>
<div class="moz-signature"><br>
</div>
</body>
</html>