看板 PHP 關於我們 聯絡資訊
今天我興沖沖在自己本機(WAMP)寫好了一隻PHP程式 放到學校IIS的主機之後 詭異的事情發生了 竟然出現錯誤訊息 是有關路徑的 訊息如下 Warning: opendir(/photos) [function.opendir]: failed to open dir: Invalid argument in D:\TMU\APPS2012\iframe.php on line 18 網址在此:http://tinyurl.com/85s93n4 完整程式碼如下: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head profile="http://gmpg.org/xfn/11"> <title>APPS 測試專用</title> <meta http-equiv='content-type' content='text/html; charset=utf-8'/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="jquery.cycle.all.js"></script> <script type="text/javascript" src="contentflow.js" load="white" ></script> <style type="text/css"> body { font-family: Georgia; line-height: 19px; background:#fafafa; } </style> </head> <body> <?php ini_set("display_errors", "On"); echo function_exists("opendir"); $base_dir = "/photos"; $fso = opendir($base_dir); echo $base_dir."<hr/>" ; while($flist=readdir($fso)){ echo $flist."<br/>" ; } closedir($fso) ?> </body> </html> 很奇怪耶 不知道開個資料夾也開不起來0.0 到底是發生啥事情啊?QAQ -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 125.227.67.234
MOONRAKER:?opendir()可以開httproot下的相對路徑嗎? 12/13 12:22
charlie0228:我最後是直接打絕對路徑,但是還是很奇怪=ˇ= 12/13 12:57
MOONRAKER:看線上手冊範例是絕對路徑 印象中以前也是用絕對的 @@ 12/13 16:52
charlie0228:所以這是IIS主機特殊的地方囉,那我只好認了 12/13 17:37
MOONRAKER:可是我的經驗是在Linux上 :( 12/13 18:00
windincloud:把/拿掉or改成./試試 12/14 00:59
charlie0228:都試過了,還是不行 12/14 21:44