2011-12-10 59 views
2

我是symfony的新手,我正在閱讀Practical Symfony,我正在Linux和Windows上工作。我使用GitHub來移動我的更改。昨天,我在我的Windows機器上創建了一個小項目,並將其推送到github https://github.com/showketbhat/medicine。我今天在Linux機器上拉了代碼,我改變了我的數據庫的一些配置。現在,當我嘗試打開我的索引頁它讓我看到以下錯誤信息: -無法打開日誌文件「../log/backend_dev.log」進行寫入?

500 | Internal Server Error | sfFileException 

無法打開日誌文件「d:\ sfproject \醫藥\日誌/ backend_dev.log」寫入。 堆棧跟蹤

* at() 
    in SF_ROOT_DIR/lib/vendor/symfony/lib/log/sfFileLogger.class.php line 75 ... 
      72.  $fileExists = file_exists($options['file']); 
      73.  if (!is_writable($dir) || ($fileExists && !is_writable($options['file']))) 
      74.  { 
      75.  throw new sfFileException(sprintf('Unable to open the log file "%s" for writing.', $options['file'])); 
      76.  } 
      77. 
      78.  $this->fp = fopen($options['file'], 'a'); 

我試圖改變權限777 backend_dev.log文件,但沒有發生。誰能幫我嗎?

使用PHP symfony項目後:權限

>> chmod 777 /home/sfprojects/medicine/cache 
>> chmod 777 /home/sfprojects/medicine/log 
>> chmod 777 /home/sfprojects/medicine/symfony 
.... 
.... 

回答

3

首先,您必須清除緩存並重新加載頁面。

rm -rf cache/* 

php symfony cc 
0

錯誤消息的路徑,D:\sfproject\medicine\log/backend_dev.log,是一個Windows路徑,而不是Linux的路徑。我猜你已經在某個配置文件中設置了它 - 將其更改爲Linux機器上的有效路徑。

+0

感謝您的回覆。這是實際的問題,我不知道如何改變它。我試圖找到這個字符串D:\ sfproject \ medicine \但找不到。所以你能幫助我嗎? – ScoRpion

0

你想使用由PHP安裝UND給出常數UNIX和Windows之間的differet DIRECTORY_SEPARATOR。