I installed Appserv and made a .php:
D:/Appserv/www/x/y/file.php
Then I have a folder, like E:/foldie
.
I want my .php to mess with that folder. I found this online:
<IfModule mod_alias.c>
Alias /foldie/ "E:/fol开发者_如何学运维die"
<Directory "E:/foldie">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</IfModule>
So I added it to my httpd.config file.Then I added the following to file.php:
echo(realpath("../../foldie/"));
I was expecting G:/foldie
, but nothing happened.
Help?
That isn't exactly how alias works. Alias means that when Apache receives a request: domain/<aliased-path>
it will return path/to/alias
. It works for HTTP requests, but it does not work for working on the local file system -- that does not go through Apache.
精彩评论