Configure Apache on Mac OSX with Environment Variables

  • Download Gist
configure-apache-path-environment-variable-on-macosx.md
Markdown

Configure Apache Path Environment Variable on Mac OSX

Problem: Apache2/PHP did not find a program to execute on its configured path

Solution: Add a new path of /usr/local/bin to Apache2's path where the program was installed

  1. Edit the Apache2 plist file with whatever editor you like (example using vim):

    $ sudo vim /System/Library/LaunchDaemons/org.apache.httpd.plist
    
  2. Add the following to the the plist file:

    <key>EnvironmentVariables</key>
    <dict>
      <key>PATH</key>
      <string>/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin</string>
    </dict>
    
  3. Restart Apache2

    $ sudo /usr/sbin/apachectl stop
    $ sudo /usr/sbin/apachectl start
    

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.