安装XAMPP
并创建index.php之后,我尝试打开我的index.php,但写错误:
禁止访问!
您无权访问所请求的目录。没有索引文档或目录是读保护的。
如果您认为这是服务器错误,请与网站管理员联系。
错误403
chat1.by Apache / 2.4.9(Win32)OpenSSL / 1.0.1g PHP / 5.5.11
文件httpd-vhosts.conf:
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot "C:\xampp\htdocs"
ServerName localhost
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "C:\xampp\htdocs\PHPProjects\chat.by"
ServerName chat.by
<Directory "C:\xampp\htdocs\PHPProjects\chat.by">
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "C:\Projects\PHP\chat.by"
ServerName chat1.by
<Directory "C:\Projects\PHP\chat.by">
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
但网站chat1.by开放正常。可能我需要添加路径&#34; C:\ Projects \ PHP \ chat.by&#34;在其他地方?
文件托管:
127.0.0.1 chat.by
127.0.0.1 chat1.by