title: PHP shell_exec, permission denied for executing -rwxrwxrwx shell script
body: <p>I am currently over ssh on a remote CentOS 5.6 system which runs an Apache webserver. I need to use the poppler <code>pdftohtml</code> binary which, unfortunately, is not currently installed on that machine. So I downloaded the poppler package and built it under my user folder. Since I  I am not the system admin, I didn't do</p>
  
  <pre><code>make install
  </code></pre>
  
  <p>and I have all my compiled files under</p>
  
  <pre><code>/users/myfolder/poppler-0.18.2/
  </code></pre>
  
  <p>The file that I need to execute through php <code>shell_exec()</code> is </p>
  
  <pre><code>/users/myfolder/poppler-0.18.2/utils/pdftohtml
  </code></pre>
  
  <p>If I execute it through my ssh bash, I get the correct output. If I, instead, put this line on a php script:</p>
  
  <pre><code>echo shell_exec("/users/myfolder/poppler-0.18.2/utils/pdftohtml");
  </code></pre>
  
  <p>I get the following output:</p>
  
  <pre><code>sh: /users/myfolder/poppler-0.18.2/utils/pdftohtml: Permission denied
  </code></pre>
  
  <p>I tried setting to 777 the file permissions, which currently are -rwxrwxrwx. I also noticed that using <code>shell_exec("whoami");</code> results in "apache". Shouldn't apache be able to execute the script if the file permissions are -rwxrwxrwx?</p>
  
  <p>I also know that installing poppler through <code>make install</code> would solve the problem but since this is for testing purpose, I would like to avoid "contaminating" the system outside my personal folder until the testing is complete.</p>
  
  <p>Thanks to anyone who will help!</p>