Hello folks,
I am running Qiime on a linux virtual Box 64Bts.
When I am on TERMINAL AND I run the command qiime@qiime-VirtualBox:~$ pynest
it works good. I can see the expected output.
But when a call from php, echo shell_exec("pynest");
or echo shell_exec("pynest.py; echo $?");
or echo shell_exec("pynest; echo $?");
it not works. I should have the expected output. Instead I have the number 127.
Is it a kind of "software not found"?
How to solve this issue?
thanks
Is the location of the executable available from the PATH that the PHP module sees? Presumably not.
Dear Devon, thanks to take your time to reply my question. I've try to give to php the complete path but it not works as well. I've use
I' ve try to call a bash script that calls the pynast but it not works. It can read the echo from bash "end of bash test" but can not run the python scrypt pynast. If I use this code
I can see on the browser
It semms to be one of the 2 reasons. 1-PHP is not reading python or 2- as you said, php is not recognizing the path of the pynast executable in python. Or both of them. i dont know how to set the module in php to see the executable on LAMP. Do you have any clue? Thanks Any information will be appreciated.
It's been a few years since I was coding in PHP and doing sys admin type things, so I don't have any quick suggestions there. You might post this on a PHP forum or maybe even stackoverflow (though they can be tougher to deal with).
Hi Devon thanks any way. Yes I found someone that had same problem as mine. He said he found a solution but it is not clear how he did that. http://stackoverflow.com/questions/11733149/i-need-to-run-a-python-script-from-php/11733888#11733888
It looks like the trick is just setting the environment variables within PHP to match those of the terminal (at least close enough that python knows where to look for things). It's been years since I've had to do that, but presumably that would solve things.
This looks like it might help: https://stackoverflow.com/questions/18098006/setting-php-enviromental-variable-while-running-command-line-script
This might be obvious, but do you realise it's 'pynast', not 'pynest'. It's not just a simple typo is it?
Just covering all bases :-)
Hi Daniel, thanks for your note, but yes. It was an error when I was tapping the post. If you see the yellow lines on my reply for Devon when I used copy past the name is correct. Thanks