How do I add paths to the Apache PATH variable?

后端 未结 4 1084
既然无缘
既然无缘 2020-11-30 11:46

I\'ve set in my custom.conf file in apache2 this:

SetEnv PATH $PATH:/opt/local/lib/mysql5/bin:/this-is-a-test

However it\'s not working. Wh

4条回答
  •  臣服心动
    2020-11-30 12:08

    Macports Apache 2.4 install

    The only way I have found to get this to stick on a reboot is to edit the macports apache2.plist. Steps I took:

    1.sudo /opt/local/sbin/apachectl stop

    2.Edit plist: /opt/local/etc/LaunchDaemons/org.macports.apache2/org.macports.apache2.plist

    And add:

    EnvironmentVariables
    
        PATH
        /usr/bin:/bin:/usr/sbin:/sbin:{add paths here}
    
    

    3.sudo port unload apache2

    4.sudo port load apache2

    5.sudo /opt/local/sbin/apachectl start

    Paths stick on a reboot. However the plist will probably be wiped on the next macports update I do.

    EDIT : And this proved to be true. I upgraded to Mojave with an associated macports update, and had to re-apply the steps above

提交回复
热议问题