title: Append to the Apache Environment Path
body: <p>I have a web accessible PHP script that is using a shell command to drop PDFs to text.  I installed Poppler, and am using pdftotext, via MacPorts.  I am able to run the command successfully from the CL, and when supplying the full path within the PHP script to '/opt/local/bin/pdftotext'.  So, I know that my $PATH is correct and the permissions are sufficient, yet I am still getting an exit status of 127: Command Not Found, when attempting to do simply 'pdftotext' in the exec().</p>
  
  <p>I have tried the answers from <a href="https://stackoverflow.com/questions/2837697/how-do-i-add-paths-to-the-apache-path-variable">How do I add paths to the Apache PATH variable?</a> and <a href="http://lists.apple.com/archives/macos-x-server/2008/Sep/msg00433.html" rel="nofollow noreferrer">http://lists.apple.com/archives/macos-x-server/2008/Sep/msg00433.html</a>.  I modified both the /etc/paths and /etc/profile, and added /etc/paths.d/macports all pointing to '/opt/local/bin'.  setenv, apache_setenv, etc all had no effect also.</p>
  
  <p>I am using a MAMP (1.9 I think) install for my local development, OSX 10.6, PHP 5.3.5, all a little behind I know :-) ... my $PATH is modified to point to the MAMP bin/php</p>