我正在尝试为我的环境设置一个全局变量,以便将APP_ENV
其全局定义为development
.
我正在使用 zsh,特别是 Mac OS X Mavericks 上的 oh-my-zsh 点文件。
我不确定如何做到这一点。我知道可以在 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 指令的虚拟服务器。
我想将它设置为机器上的整体外壳或系统范围的一部分。
有什么建议吗?