Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save bdone/5944dd3c3d3356c0babe to your computer and use it in GitHub Desktop.
Save bdone/5944dd3c3d3356c0babe to your computer and use it in GitHub Desktop.
Configure Apache on Mac OSX with Environment Variables

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
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment