我的配置似乎有效,因为我可以访问虚拟主机下的文件,例如@using PagedList.Mvc;
@using PagedList;
@model IPagedList<Cmedia.Models.Employee>
@foreach (var item in Model)
{
@Html.DisplayFor(modelItem => item.EmployeeID)
@Html.DisplayFor(modelItem => item.EmployeeName)
<br>
}
Page @(Model.PageCount < Model.PageNumber ? 0 : Model.PageNumber) of @Model.PageCount
@Html.PagedListPager(Model, page => Url.Action("Index", new { page }))
。但是一旦我尝试进入PHP页面,我的浏览器(Chrome和Firefox)就开始下载该文件(例如http://sailing/test.txt
)。
http://sailing/phpinfo.php
<VirtualHost *:80>
DocumentRoot "F:/wamp/www"
ServerName localhost
ServerAlias localhost
<Directory "F:/wamp/www">
AllowOverride All
<IfDefine APACHE24>
Require local
</IfDefine>
<IfDefine !APACHE24>
Order Deny,Allow
Deny from all
Allow from 127.0.0.1 localhost ::1
</IfDefine>
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "F:/wamp/www/sailing"
ServerName sailing
ServerAlias sailing
<Directory "F:/wamp/www/sailing">
AllowOverride All
<IfDefine APACHE24>
Require local
</IfDefine>
<IfDefine !APACHE24>
Order Deny,Allow
Deny from all
Allow from 127.0.0.1 localhost ::1
</IfDefine>
</Directory>
</VirtualHost>
和localhost
也正在发挥作用。我使用的是WampServer 2.5(Apache 2.4.9,PHP 5.5.12,MySQL 5.6.17)。
最小配置似乎也无法发挥作用。
localhost/phpmyadmin