Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
538 views
in Technique[技术] by (71.8m points)

php - Setting Environment Variables in MAMP?

I assume that MAMP environment variables can be set in ~/.bash_profile, but it seems that setting them there does not always take effect right away. For instance, I just set a variable in my .bash_profile and have tried restarting MAMP servers, restarting MAMP itself, and even logging out of my computer and nothing seems to work. The variable is still not accessible from within my environment. Is there another way to set MAMP env vars that I'm missing or is there a cache that I need to clear?

Thanks in advance.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You can also set PHP environment variables in MAMP Pro (not available in MAMP) in the additional parameters for <VirtualHost>: section found in the extended tab of the hosts settings panel.

mamp setting php environment variable

Screenshot is from MAMP Pro v 3.0.3


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...