2014-02-20 164 views
0

網站正在PHP下運行。使用Smarty 3.1.x無法寫入文件

網站工作正常,大約半年沒有任何變化!約2-3個星期前就開始接受錯誤日誌:

2014-02-21 0:22:19 - CRIT --> unable to write file D:\home\site\wwwroot\/include/smarty/templates_c\bc3a2c744a52ffed3fac136ce7e5bacb0648e1ba.file.ik_home.tpl.php. Line: 74. File: D:\home\site\wwwroot\include\smarty\libs\sysplugins\smarty_internal_write_file.php 

而是文件名,應創建,蔚藍的主機創建了奇怪的名字的文件,即

wrt530644e3a6c503.24424555

代替

bc3a2c744a52ffed3fac136ce7e5bacb0648e1ba.file.ik_home.tpl.php

我可以wrt530644e3a6c503.24424555到期望bc3a2c744a52ffed3fac136ce7e5bacb0648e1ba.file.ik_home.tpl.php使用FTP客戶端

的var_dump重命名(is_writable( '〜/包含/ smarty的/ templates_c')); // bool(true)

我在SO Smarty - 'unable to write file... templates_c'. (smarty_internal_write_file.php:44)中發現了一個類似的問題,但它沒有答案並且已關閉。作者剛剛說他的託管公司固定的權限。

還有一個SO問題WindowsAzure: Is it possible to set directory permissions within the web.config?答案解釋瞭如果發生硬盤故障,將我的文件移動到另一個機架和重建實例時會發生什麼。在這種情況下,我應該如何處理權限?我真的不知道實際上是否有任何失敗:)

回答

0

問題已解決。問題出在路徑中的雙後/斜線。更改:

D:\home\site\wwwroot\/include/smarty/templates_c\bc3a2c744a52ffed3fac136ce7e5bacb0648e1ba.file.ik_home.tpl.php 

D:\home\site\wwwroot/include/smarty/templates_c\bc3a2c744a52ffed3fac136ce7e5bacb0648e1ba.file.ik_home.tpl.php 

爲什麼Azure的停在路處理雙斜線?