Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've just installed ImageMagick using macports and am trying to use it from a php site running on Apache, but nothing I do works to add /opt/local/bin:/opt/local/sbin to my path.

So far I've tried

  • adding an export to .bash_profile (macports already did this for me)
  • adding an environment variable declaration to or.apache.httpd.plist, which totally overwrites the path (using $PATH to refer to the previous path doesn't get recognised)
  • redefining the PATH in /usr/sbin/envvars
  • using export in /usr/sbin/envvars
  • using setenv in launchd.conf
  • using export in launchd.conf
  • adding to the list in /etc/paths

Any ideas

share|improve this question
Is this the standard apache/php included in OS X or did you install a MAMP distribution (and if yes, which one)? Does IM work if you specify the full path from within your PHP code or if you symlink the binaries to /usr/bin for testing? – patrix Apr 22 '13 at 13:11
It is the standard OSX apache and PHP. Symlinks was a fantastic idea and works perfectly (why doesn't macports do this for me?! I thought the whole point was that it avoids your having to muck around with stuff like this) – wheresrhys Apr 23 '13 at 8:23

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.