我的服务器上有两个虚拟主机。一个“网络”和一个“移动”。我可以正常查看“users”目录下的“web”文件,但不能上传或创建目录?!!
例如:
<img src='http://m.domain.com/users/imgs/sample.png' /> this is viewable
//this is not possible
<?php
mkdir("users/newDir"); //fails
$img = file_get_contents("http://images.devshed.com/fds/belts/ds_forums.gif");
$file = "users/newDir/sample.gif";
file_put_contents($file, $img); //fails
$img = file_get_contents("http://images.devshed.com/fds/belts/ds_forums.gif");
$file = "users/sample.gif";
file_put_contents($file, $img); //fails
?>
我的移动虚拟设备下有以下内容指向我的“网络”上的文件:
<VirtualHost *:80>
ServerName domain.com
ServerAlias m.domain.com
DocumentRoot "C:/Apache/mobileroot"
<Directory "C:/Apache/mobileroot">
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
Alias /users/ "C:/Apache/webroot/users/"
<Directory "C:/Apache/webroot/users/">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>