This issue existed in 10.10 but came back with 10.11 the fix in 10.10 was to modify /System/Library/LaunchDaemons/org.apache.httpd.plist and adding the following key
<key>EnvironmentVariables</key>
<dict>
<key>PATH</key>
<string>/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin</string>
</dict>
10.11 the file is locked down by the system. I've tried creating my own version of the file in /Library/LaunchDaemons and then using launchctl to unload the System version and load mine.
this works but fails to hold on a reboot. adding the -w option doesn't help either with holding through a reboot.
Is there another option besides disabling the system protection and modifying the file in the system folder? I'd like a solution that holds through apple updates.
thanks
Was able to figure this out with the following:
sudo cp /System/Library/LaunchDaemons/org.apache.httpd.plist /Library/LaunchDaemons/org.apachecustom.httpd.plist
Edit this custom version. Be sure to update the label key with the new file name.
Turn off the old version with
sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist
turn on the new version with
sudo launchctl load -w /Library/LaunchDaemons/org.apachecustom.httpd.plist
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.