我遇到了scandir()
问题。我试图在我的云中的子域下的页面上显示我的snaps
目录中的文件。scandir无法打开目录
这是我使用的PHP。
$files = scandir('./snaps');
print_r($files);
并且这是错误。
Warning: scandir(./snaps) [function.scandir]: failed to open dir: No such file or directory in /home/u703778423/public_html/cloud/index.php on line 39
Warning: scandir() [function.scandir]: (errno 2): No such file or directory in /home/u703778423/public_html/cloud/index.php on line 39
我不知道该怎么办。
你怎么知道的?没有提到,'。/ snaps'应该在哪里,但只有'。/ snaps'丢失。 – KingCrunch 2012-08-09 14:35:50
@KingCrunch:因为脚本的位置是在错误信息中指定的,而scandir中的路径是'。/ snaps'。 – 2012-08-09 14:36:57
捕捉直接在public_html中。 – 2012-08-09 14:37:12