我正在尝试为我的环境设置一个全局变量,以便APP_ENV
全局定义为development
。
我在Mac OS X Mavericks上使用zsh,特别是oh-my-zsh dotfiles。
我不确定如何做到这一点。我知道可以在httpd-vhosts.conf中设置环境,但是我使用apache动态多个主机,所以我的httpd-vhosts.conf看起来像这样:
#
# Virtual Hosts
#
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.2/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.
#
# Use name-based virtual hosting.
#
NameVirtualHost *:80
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
#allow access to the Hosts directory where your sites are
<Directory "/Volumes/site/%1">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
#get the server name from the Host: header
UseCanonicalName Off
VirtualDocumentRoot /Volumes/site/%0/public/
ServerAdmin user@example.com
ServerName vhosts.dev
此外,我还使用laravel开发了一些应用程序,并使用php artisan serve
生成虚拟服务器,该服务器不会从apache httpd-vhosts.conf文件中获取APP_ENV指令。
我想将它设置为整个shell或系统范围内的一部分。
有什么建议吗?