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

Popular posts from this blog

1111. appearing after print sequence - php -

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

Ruby on Rails, ActiveRecord, Postgres, UTF-8 and ASCII-8BIT encodings -