【发布时间】:2012-02-02 11:33:35
【问题描述】:
我想删除 webroot 之外的 php(取消链接功能)文件。我的网络根在
C:\server\webroot\project\... in webroot I have folder named project and in there I have .php files.
关于文件目录的内容。它位于 C:\server\mp3_files...
我还在 httpd.conf 中创建了 mp3_files 目录的 Alias("mp3")
我在 C:\server\webroot\project\test.php 中编写这个脚本
脚本就是这样 =>
function delete($filename){
if (unlink("/mp3/" . $filename)){
echo "Deleted";
} else {
echo "No";
}
}
delete("file.txt");
这个脚本在 php-errors => PHP-WARNING No such file or directory 中给出了我
我在 (test.php) html 中也有这个 =>
<a href="/mp3/file.txt">Download</a>
这有效(它会打开这个 file.txt)
所以我想知道为什么不能用标记函数“delete($filename)”删除?
【问题讨论】:
-
PHP 不知道 Apache 别名文件夹。您必须使用绝对或相对路径。