I want to run a python/scrapy script from my PHP environment. I run it on a limited server, but could make it work using these commands on bash:
cd /www/path/to/python-script/
source $HOME/anaconda3/bin/activate ~/anaconda3
scrapy crawl project -o /www/path/to/destination-folder/bla.csv
Now I have a hard time to replicate this with PHP. The following try does not work, unfortunately:
$run = shell_exec("cd /www/path/to/python-script/;
source $HOME/anaconda3/bin/activate ~/anaconda3;
scrapy crawl project -o /www/path/to/destination-folder/bla.csv");
var_dump ($run);
The result is NULL
How could I run a python script in the anaconda environment from PHP with absolute folders unrelated to the PHP script?