2008年9月10日 星期三

IIS對php相容性不高

前幾天在架IIS with php module,希望可以在IIS的環境下能跑ASP、PHP、ASP.NET,所以沒有考慮採用apache當web server的方案,灌好之後接著再裝php的framework CakePHP,在安裝的過程中非常不順利,一執行index.php就出現一堆要執行寫入暫存檔的function 出現 Permission denied,意思是指寫入檔案是不被允許的,接著我就朝著權限這方面去設定,出了將IIS中的該目錄寫入權限啟動外,也到檔案總管將該目錄的所有權限打開,執行的結果依然還是出現 Permission denied,從warning的訊息可以看出是touch這個function,所以我就去官網查Manual上面寫內容如下:

touch

(PHP 4, PHP 5)

touchSets access and modification time of file

Description

bool touch ( string $filename [, int $time [, int $atime ]] )

Attempts to set the access and modification times of the file named in the filename parameter to the value given in time . Note that the access time is always modified, regardless of the number of parameters.

If the file does not exist, it will be created.

Parameters

filename

The name of the file being touched.

time

The touch time. If time is not supplied, the current system time is used.

atime

If present, the access time of the given filename is set to the value of atime

Return Values

Returns TRUE on success or FALSE on failure.

ChangeLog

Version Description
5.3.0 It became possible to change the modification time of a directory under Windows.

看起來好像沒什麼問題!結果在Note的部分出現重要的資訊

Important info:

touch() used on a directory always returns FALSE and prints "Permission denied" on NTFS and FAT Filesystem (tested on winXP).


意思就是touch在NTFS、FAT是無效的,不過我在WinXP灌Apapch with php module跑CakePHP就正常,也沒有出現Permission denied的問題!