html - php script to run bash script which runs scrapy crawler -
i have form in html page has action run php file. php file has run bash function command in turn runs scrapy spider. since have scrapy spider located outside var/www/, have added function in .bashrc run bash command ($ startscript) anywhere. when run on terminal var/www folder or anywhere works expected when in php file not work. not sure if because of php file permission, scrapy proprieties or else.
any suggestions?
.php file:
<?php $output = shell_exec('startscript'); echo $output; ?> .bashrc file:
function startscript { cd /home/pi/indeedcoukcrawl ./botscrapy.sh }
so can try:
put absolute path of startscript in shell_exec , see if works.
try running error_reporting(e_all) , see if give error/notice
check if webserver has permissions run file. try putting file same group webserver runs in.
Comments
Post a Comment