首先感谢您阅读我的问题:
我在Zend framework1.11中创建了一个模块
模块名称 =客户端
现在根据我们的要求,我们需要在wamp服务器上创建虚拟主机。
以下是我在 C:\ wamp \ bin \ apache \ Apache2.4.4 \ conf \ extra / httpd-vhosts.conf
中所做的设置<VirtualHost *:80>
ServerAdmin client.com
DocumentRoot "C:/wamp/www/loyality/application/modules/client/"
ServerName client.com
ServerAlias www.client.com
ErrorLog "logs/dummy-host.example.com-error.log"
CustomLog "logs/dummy-host.example.com-access.log" common
</VirtualHost>
之后启用 C:\ Windows \ System32 \ drivers \ etc / hosts
下的窗口主机文件但是我收到错误 500内部服务器错误
在错误日志中,我发现以下错误:
[Fri Jan 02 12:47:12.154296 2015] [core:error] [pid 4324:tid 1600] [client 127.0.0.1:50923] AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
请建议,如何在zend框架中为模块 虚拟主机
答案 0 :(得分:2)
我们可以通过以下设置解决此问题:
这里我使用的是Wamp服务器,Zend框架。
第1步:首先我们需要在apache文件中启用Include conf/extra/httpd-vhosts.conf
行 httpd.conf
例如:
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
第2步:我们需要在{\ _ {}}文件中定义虚拟主机,该文件位于bin \ apache \ Apache2.4.4 \ conf \ extra \ httpd-vhosts.conf < / p>
例如:我们可以像下面的代码一样定义虚拟主机。
httpd-vhosts.conf
步骤3:现在我们需要将IP地址映射到不同的主机名 例如:
<VirtualHost *:80>
DocumentRoot "C:/wamp/www/loyality/public/"
ServerName pizzahut.com
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "C:/wamp/www/loyality/public/"
ServerName dominos.com
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "C:/wamp/www/loyality/public/"
ServerName client.com
</VirtualHost>
步骤4:在index.php文件中为公共文件夹中的默认模块定义或添加常量。
例如:
127.0.0.1 localhost
127.0.0.1 pizzahut.com
127.0.0.1 www.pizzahut.com
127.0.0.1 localhost
127.0.0.1 dominos.com
127.0.0.1 www.dominos.com
127.0.0.1 localhost
127.0.0.1 client.com
127.0.0.1 www.client.com
步骤5:使用以下代码在application.ini文件中启用默认模块。
defined('DEFAULT_MODULE') || define('DEFAULT_MODULE', "dominos");
通过以上步骤,我找到了解决这个问题的方法。
现在我们的默认模块是多米诺骨牌,当我运行http://www.dominos.com时,我的多米诺骨牌模块指向。
谢谢, Sunny Patial。