Skip to content

Instantly share code, notes, and snippets.

@carlcs
Created June 21, 2018 10:02
Show Gist options
  • Save carlcs/c3f9803cfd67aed7699ffcb5d20d6c8a to your computer and use it in GitHub Desktop.
Save carlcs/c3f9803cfd67aed7699ffcb5d20d6c8a to your computer and use it in GitHub Desktop.

Apache env variables

Output the PATH env variable:

echo getenv('PATH');
die();

These don’t work with a brew services started httpd:

~/.bash_profile
~/.bashrc
~/.profile
/etc/paths

Instead env variables need to be added to the service’s .plist (see path via brew services list):

/Library/LaunchDaemons/homebrew.mxcl.httpd.plist

<key>EnvironmentVariables</key>
<dict>
  <key>PATH</key>
  <string>/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin</string>
</dict>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment