我坚持这个问题4天了,我无法解决它。 我有一个zend 1项目。 Php版本5.4.37,apache 2.2.4。 首先使用msi安装程序安装Apache。 Apache配置:
LoadModule php5_module "c:/Apache2.2/PHP/php5apache2_2.dll"
AddType application/x-httpd-php .php
AddType application/x-httpd-php .phtml
PHPIniDir "c:/Apache2.2/PHP"
启用虚拟主机
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
启用rewrite_module
LoadModule rewrite_module modules/mod_rewrite.so
此外该项目需要apc ext for php所以我也包括它。同样在httpd.conf中,我指出了php ext文件夹。
虚拟主机
<VirtualHost *:80>
ServerAdmin webmaster@rma.com
DocumentRoot "C:\Apache2.2\htdocs\rma\public"
ServerName rma.com
ErrorLog "logs/rma-error.log"
CustomLog "logs/rma-access.log" common
SetEnv APPLICATION_ENV "development"
<Directory C:\Apache2.2\htdocs\rma\public>
Options Indexes MultiViews FollowSymLinks
DirectoryIndex index.php index.html
AllowOverride All
Order allow,deny
Allow from all
</Directory>
当我尝试打开rma.com时,我得到“页面没有正确重定向”。 我做错了什么?提前谢谢!
更新
在.htaccess中我有这个
# Option 1:
# Rewrite "www.domain.com -> domain.com"
<IfModule mod_rewrite.c>
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
</IfModule>
RewriteEngine On
#Rma Version Stamp for CSS and JS
RewriteRule ^(css|js)/(.*).lvs([0-9]{5,10}).(css|js)$ /$1/$2.$4 [NC,L]
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^api/1.0/soap.*$ /api/1.0/soap.php [NC,L]
RewriteRule ^api/1.0/json.*$ /api/1.0/json.php [NC,L]
RewriteRule ^deamon.*$ /deamon/index.php [NC,L]
RewriteRule ^.*$ index.php [NC,L]
<IfModule mod_headers.c>
Header set X-UA-Compatible "IE=Edge,chrome=1"
# mod_headers can't match by content-type, but we don't want to send this header on *everything*...
<FilesMatch "\.(js|css|gif|png|jpe?g|pdf|xml|oga|ogg|m4a|ogv|mp4|m4v|webm|svg|svgz|eot|ttf|otf|woff|ico|webp|appcache|manifest|htc|crx|xpi|safariextz|vcf)$" >
Header unset X-UA-Compatible
</FilesMatch>
</IfModule>
在我卸载xampp之前,该项目曾经工作过。现在我想学习如何手动配置我的env。