Как установить переменную среды в MAMP (версия 3.3), которую я могу использовать в своем приложении PHP?Как установить переменную среды в MAMP?
Я обновил /Applications/MAMP/Library/bin/envvars_ and envvars-std_ file
и добавьте следующие строки:
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#
# envvars-std - default environment variables for apachectl
#
# This file is generated from envvars-std.in
#
if test "x$DYLD_LIBRARY_PATH" != "x" ; then
DYLD_LIBRARY_PATH="/Applications/MAMP/Library/lib:$DYLD_LIBRARY_PATH"
else
DYLD_LIBRARY_PATH="/Applications/MAMP/Library/lib"
fi
export DYLD_LIBRARY_PATH
MY_TEST_DETAIL="foo"
export MY_TEST_DETAIL
#
Я посмотрел в phpinfo() и не в состоянии найти MY_TEST_DETAIL.
Может ли кто-нибудь сказать мне, что я делаю неправильно? Спасибо заранее.
Этот метод, используемый для работы в MAMP 2.x – doublejosh