修改php配置文件。打开xampp安装目录进入php目录找到如下文件,
如本例的路径为D:\xampp\php\php.ini 打开php.ini 文件,
将内容display_errors=off修改为display_errors=on ,
修改error_reporting值,改为error_reporting=E_ALL & ~E_NOTICE(可以使用查找功能,方便找到上述内容)
4:创建虚拟主机。如本例,创建一个名为test的虚拟主机,网站目录位于C:\test\ 打开C:\Windows\System32\drivers\etc\hosts 向其中添加如下行 127.0.0.1 localhost 127.0.0.1 test
接着到C盘根目录创建名为test的文件夹。
打开D:\xampp\apache\conf\extra\httpd-vhosts.conf向文件末尾添加如下行
NameVirtualHost 127.0.0.1:80
<VirtualHost 127.0.0.1:80>
DocumentRoot "D:/xampp/htdocs"
ServerName localhost
</VirtualHost>
<VirtualHost 127.0.0.1:80>
DocumentRoot "C:/test/"
ServerName test
<Directory C:/test/>
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
D:\ProgramFiles\XAMPP\apache\conf\httpd.conf
DocumentRoot