title: Run Python Script from PHP Docker
body: <p>I am running a Docker. Here is my docker file.</p>
  
  <pre><code>FROM php:5.6-apache
  
  RUN apt-get update &amp;&amp; apt-get install -my wget gnupg
  RUN apt-key adv \
          --keyserver hkp://keyserver.ubuntu.com:80 \
          --recv 7F0CEB10
  RUN echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.0 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-3.0.list
  RUN apt-get update
  RUN apt-get update &amp;&amp; apt-get install -y \
          libfreetype6-dev \
          libmcrypt-dev \
          libssl-dev 
  RUN apt-get install -y libmariadbclient-dev
  RUN docker-php-ext-install iconv mcrypt mysqli pdo_mysql mysql zip mbstring
  RUN pecl install mongo
  RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/bin --filename=composer
  RUN sed -i 's/^ServerSignature/#ServerSignature/g' /etc/apache2/conf-enabled/security.conf; \
      sed -i 's/^ServerTokens/#ServerTokens/g' /etc/apache2/conf-enabled/security.conf; \
      echo "ServerSignature Off" &gt;&gt; /etc/apache2/conf-enabled/security.conf; \
      echo "ServerTokens Prod" &gt;&gt; /etc/apache2/conf-enabled/security.conf; \
      a2enmod ssl; \
      a2enmod headers; \
      echo "SSLProtocol ALL -SSLv2 -SSLv3" &gt;&gt; /etc/apache2/apache2.conf
  RUN apt-get install -y vim
  RUN apt-get update &amp;&amp; apt-get install -y python3 python3-pip
  RUN pip3 install numpy
  RUN pip3 install scipy
  RUN pip3 install image_match
  RUN pip3 install opencv-python
  RUN pip3 install pytube
  RUN pip3 install ez_setup
  RUN pip3 install moviepy
  RUN pip3 install requests
  RUN pip3 install ffmpeg-python
  RUN apt update &amp;&amp; apt install -y libsm6 libxext6
  RUN apt-get install -y libxrender-dev
  RUN apt-get update
  COPY config/mongo.ini /usr/local/etc/php/conf.d/
  
  ENV VERSION 8
  ENV UPDATE 91
  ENV BUILD 14
  </code></pre>
  
  <p>In one my PHP Page, I want to Run a python script. for e.g.</p>
  
  <pre><code>$command = escapeshellcmd('python integrateFinal.py');
  $joutput = shell_exec($command);
  $output=json_decode($joutput);
  </code></pre>
  
  <p>The python script works fine with the command line as 'docker-compose exec web python3 integrateFinal.py'. It works and gives the output but when I run it from PHP page mentioned above It gives me error as permission denied.</p>
  
  <p>So How should I run this PYTHON script? </p>