Installing LifeType FAQ

Installing LifeType FAQ

出自LifeType 中文文件計畫

跳轉到: 導航, 搜尋

目錄

安裝常見問題集

本區是用來整理 LifeType中文論壇 上安裝與設定相關的常見問題。希望能對入門的使用者有些許的幫助。問題內容將隨論壇問題數量增加,目前尚在整理中。

把 LifeType 的程式上傳到我的網站之後,要怎麼開始安裝呢?

當你把 LifeType 的程式成功的上傳到你的網站上後,你必須要執行安裝精靈,才能安裝 LifeType 程式。這時候你如果直接看你網站,你將會看到:

The wizard.php script has to be removed after the installation process.
Please remove it first to continue.

安裝的方式很簡單。直接在瀏覽器的網址列輸入 http://your-blog-url/wizard.php 就可以執行安裝精靈,然後開始安裝了。安裝完畢後記得要把 wizard.php 這個程式刪掉,否則你會一直看到上面的訊息喔。

更詳細的安裝步驟,請參考 使用安裝精靈來安裝 LifeType

為什麼執行安裝精靈時,一直出現 Error 500 的錯誤呢?

當你發現 LifeType 上傳後,不管執行任何程式都是出現下面的錯誤訊息:

Server error!
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an error in a CGI script.
If you think this is a server error, please contact the webmaster
Error 500

這表示你的主機並不支援使用 .htaccess 來修改 Apache 的設定。如果你是使用虛擬主機來架設 LifeType,那麼唯一的解決方式就是把 LifeType 根目錄下的 .htacess 移除。只是這樣子你就無法使用簡潔網址與自訂網址的功能了。

如果這是你自己的主機,那麼你可以修改 Apache 的設定,在 httpd.conf 加入:

  1. <Directory "你的 LifeType 絕對目錄">
  2. Options Multiviews
  3. AllowOverride All
  4. Order allow,deny
  5. Allow from all
  6. </Directory>

存檔後,記得要重新啟動 Apache,這樣你的修改才能生效喔。

為什麼安裝到步驟二時會出現 Table 'xxx_articles' doesn't exist 的訊息?

如果你安裝到步驟二出現下面的錯誤訊息:

New table Map of categories to articles created successfully.
New table Definition of custom fields created successfully.
New table Custom fields that have been assigned to articles created successfully.
New table Text of the articles created successfully.
** New tables created successfully **
Error modifying table Articles: Table 'plog_articles' doesn't exist
Table 'plog_articles' doesn't exist
Table 'plog_articles' doesn't exist
...

那代表你自行修改了 /config/config.properties.php 這個檔案,所以 LifeType 把安裝過程當作『程式升級』,而非『全新安裝』。解決方式就是重新解壓縮把未修改過的 config.properties.php 上傳/複製到 LifeType 的 /config 目錄,然後重新執行安裝精靈(http://your-blog-url/wizard.php)。

為什麼安裝時一直出現 failed to open stream 的訊息呢?

如果你安裝時一直出下面的訊息,那代表你的檔案權限不對,所以 LifeType 無法幫你安裝。

fopen(./tmp/3f4c7de95a680): failed to open stream: Permission denied

或是

Smarty error: problem writing temporary file './tmp/3f4c7de95a680'

或是

touch(): Unable to create file ./tmp/wizard^intro.template because Permission denied

或是

fopen(/Users/oscar/plog/config/config.properties.php): failed to open stream: Permission denied

解決方式很簡單啦!如果你是在 Linux 系統下安裝,只要透過命令列(你自己的機器)或是 FTP (如果你是用虛擬主機)修改下面的目錄與檔案權限就可以了:

chmod 777 your-blog-folder/config/config.properties.php
chmod 777 your-blog-folder/tmp

安裝後,記得把 config.properties.php 的檔案權限改回 644,確保你的 LifeType 不會被別人讀取。

chmod 644 your-blog-folder/config/config.properties.php

如果,你是在 Windows 下安裝,你可以在檔案總管中移動滑鼠到 your-blog-folder/config/config.properties.php 這個檔案上,按一下右鍵會跳出選單,在選單上選擇『內容』,然後在跳出的對話框中的『一般』標籤下面,把 唯讀 這個選項取消就可以了。安裝完後,記得再把 唯讀 這個選項勾選起來,以確保你的網站安全。

當我使用/安裝的時候,為什麼一直出現 空白頁面Allowed memory size of 8388608 bytes exhausted 的訊息呢?

如果你在安裝或是使用 LifeType,卻突然出現空白頁面或是下面的訊息時:

Fatal error:  
Allowed memory size of 8388608 bytes exhausted (tried to allocate 11520 bytes) in /var/www/blog/class/template/smarty/Smarty_Compiler.class.php on line 1580

那代表你的 PHP 的設定的記憶體使用限制,並不允許 LifeType 使用超過 8MB 的記憶體。解決的方式如下:

1. 如果這是你的機器,那麼你可以修改 php.ini。把 php.ini 中的 memory_limit 改為下面的設定:

memory_limit=16M

2. 如果這是虛擬主機,而你得主機商允許你修改 .htaccess,那麼你可以在 .htaccess 加入:

php_value memory_limit 16M

3. 最後。如果主機商不允許你修改 .htaccess 那麼你剩下的辦法就是修改程式了。請把 LifeType 根目錄下的 index.phpsummary.phprss.phpadmin.php 幾個程式全加上:

  1. ini_set("memory_limit", "16M");

為什麼我上傳的檔案一直沒辦法超過 2MB 呢?

這要分成兩個部分來看了,一個是 LifeType 本身的設定,另一個是 PHP 的設定。

LifeType 的設定,我們可以在管理介面中 全部站台管控 ? 上傳設定 ? maximum_file_upload_size 找到上傳限制的設定值,預設值是 2000000。在 LifeType 中這個參數的單位是 Byte,所以 2000000 代表的就是 2MB。請把他改成你希望的設定值,例如 10MB,那麼就請把他改為 10000000,記得一定要按下『更新』,這個設定值才會生效。

再來就是要更改 PHP 的設定,在 PHP 中共有兩個參數 post_max_sizeupload_max_filesize 需要修改:

1. 如果這是你的機器,那麼你可以修改 php.ini,把這兩個參數改為:

post_max_size=10M
upload_max_filesize=10M

2. 如果這是虛擬主機,而你得主機商允許你修改 .htaccess,那麼你可以在 .htaccess 加入:

php_value post_max_size 10M
php_value upload_max_filesize 10M

3. 最後。如果主機商不允許你修改 .htaccess 那麼你剩下的辦法就是修改程式了。請把 LifeType 根目錄下的admin.php 加上:

  1. ini_set("post_max_size", "10M");
  2. ini_set("upload_max_filesize", "10M");

以上兩個方法如果都試過了,卻還是沒有辦法上傳 10MB 的檔案,那麼可能還有一個地方需要修改,那就是 Apache 的設定。請把 Apache 的 LimitRequestBody 這個參數改為你要的大小,如 10000000 (10MB),改過後記得重新啟動 Apache。可能的參數設定檔因不同的系統而異:

  • Windows:在 Apache 安裝目錄的 /conf/httpd.conf 中
  • Linux:在 Apache 安裝目錄的 /conf/httpd.conf 或是 conf/php.conf 中。可以用下面的 Linux 指令來搜尋比較快。
find / -name httpd.conf
find / -name php.conf

我可不可以用 summary.php 來當作我的首頁呢?

summary.php 是 LifeType 特別提供的社群網誌資訊彙整頁面,要拿他來當作首頁,當然是很適合的。

修改方式很簡單,只要修改 LifeType 安裝的根目錄下的 .htaccess 檔案,在最前面加上下面的參數設定,就可以了。

  1. DirectoryIndex summary.php index.html index.php

如果你在修改之候,你的瀏覽器出現 Error 500 的錯誤,那代表的是你的 Apache 不允許你使用 .htaccess 來覆蓋伺服器原先的設定。請參考:為什麼執行安裝精靈時,一直出現 Error 500 的錯誤呢? 來修正。

為什麼安裝完成後 我的網頁看起來都是亂碼,我明明是選擇繁體中文啊?

當你發現你正常的安裝 LifeType 後,可是你的網頁卻出現亂碼,或是一定要在瀏覽器中特別指定編碼才能看到正常的文字。哪可能是你的 Apache 指定了 網頁預設輸出編碼。只要把 Apache 的 AddDefaultCharset 參數移除就可以解決了。

請在 httpd.conf 中尋找 AddDefaultCharset 這個字串。找到後,在這個參數前面加上 # 號就可以了。

  1. #AddDefaultCharset utf-8

修改後,記得重新啟動 Apache,這樣才能讓你的修改生效。

老天呀!我是 LifeType 網站的管理者,可是我忘了我的密碼,我應該怎麼辦呢?

恭喜你,這是最不應該發生的錯誤。但是,如果真的發生了,那麼唯一的方法就是重設密碼!

因為 LifeType 並未直接儲存使用者的真實密碼,而是儲存經由 MD5 編碼過的密碼。這樣可以避免當你的網站被『駭』的時候,『駭客』無法取得真實的使用者密碼,這是對使用者的保護。

重設密碼的方式必須對資料庫的直接操作,你可以透過 phpMyAdmin 或是 MySQL 命令列的方式來進行。執行下面的 SQL 來重設你的密碼:

UPDATE plog_users SET password = MD5('your_new_password') WHERE user = 'your_username';

plog_ 是 LifeType 預設的資料表前置碼,你必須更改為你自己的前置碼。

為什麼我重新開啟瀏覽器瀏覽我的網誌就可以看到網誌頁面,可是當我點下其中的任何連結就會出現空白頁呢?

你必須要先察看你的 Apache 有沒有紀錄任何錯誤訊息,如果你發現 Apache 給你的錯誤訊息是:

PHP Fatal error:  Unknown(): The script tried to execute a method or access a property of an incomplete object you are trying to operate on was loaded _before_ the session was started in /usr/home/www/plog/class/action/blogaction.class.php on line 54
PHP Fatal error:  Unknown(): The script tried to execute a method or access a property of an incomplete object you are trying to operate on was loaded _before_ the session was started in/usr/home/www/plog/class/action/blogaction.class.php on line 177

那很有可能你的 PHP 的 session 設定錯誤。解決的方式是把 php.ini 中 的 session.auto_start 參數設為 0。

session.auto_start = 0

我是大陸/台灣的用戶,我不想用 LifeType 內建的 UTF-8 編碼,可以改為 GB2312/Big5 編碼嗎?

可以!可是因為 GB2312/Big5 並非 LifeType 官方支援的編碼,所以可能某些功能上會有錯誤,請自行斟酌使用。

請依下面的步驟來將語系檔轉為 GB2312/Big5 的編碼:

1. 先去下載 ConvertZ ,這是由 ALF 所開發的簡繁轉換軟體,它大概是目前網路上你能找到最棒的軟體了。

2. 打開 /locales/locale_zh_CN.class.php(UTF-8 簡體中文)或是 /locales/locale_zh_TW.class.php(UTF-8 繁體中文)。

3. 把其中

  1. $messages['encoding'] = 'UTF-8';

改為

  1. $messages['encoding'] = 'GB2312';

或是

  1. $messages['encoding'] = 'Big5';

4. 然後用 ConvertZ 把整個檔案轉成 GB2312/Big5 的編碼 (選用 UTF8->GB2312 或 UTF8->Big5)。

5. 到 全部站台管控 ? 全域設定個人網誌設定 ? 網誌設定,把預設的語系先改為 en_UK。

6. 再到 全部站台管控 ? 語系檔案列表把 zh_CN 或是 zh_TW 語系刪除。

7. 然後到 全部站台管控 ? 新增語系,把你修改過的zh_CN 或是 zh_TW 語系新增回 LifeType。

8. 最後再到 全部站台管控 ? 全域設定個人網誌設定 ? 網誌設定,把預設語系從 en_UK 改回 zh_CN 或是 zh_TW 語系,這樣就可以了!

請注意:

  • 為什麼要這麼麻煩呢?
因為當你安裝的時候,LifeType 已將把語系的『編碼』資料寫到資料庫了。 所以,如果你不刪除再新增,那麼不管你怎麼改, LifeType 永遠認定他是 GB2312 或 Big5 編碼。
  • 另外一個方式,是用改過的語系重新安裝,這是最簡單的方式了。

但是,我還是誠心建議你使用 UTF-8 編碼啦!因為跟國際的 Blogger 們接軌比較不會有問題。例如,引用的時候,如果用 GB2312/Big5 引用 UTF-8 編碼的網站的文章,在對方的網站就會出現亂碼。這實在是很不禮貌的行為啊。

所以請不要再問『為什麼不用 GB2312/Big5 當作預設編碼?』這種問題了。
沒有政治上的考量,也不是技術上的優劣。
純粹是為了加強『國際交流』上的考量啊!

請問我可以在 IIS 中使用 LifeType 的 Mod_Rewrite 功能來做簡潔網址嗎?

可以的。這要感謝 IISMods 這家公司,他們以 Open Source 的方式,釋出 IIS 的 Mod_Rewrite 模組

安裝方式如下:

1. 到 IISMods 下載 URL Rewrite Filter for IIS

2. 參考 Mod_Rewrite 的文件,來把 Mod_Rewrite 裝到 IIS 上。

3. 修改 mod_rewrite.ini 檔

  1. ###########################
  2. Debug 0
  3. Reload 5000
  4.  
  5. # Permalink to the blog entry (i.e. /plog/1_userfoo/archive/3_title-foo-bar.html)
  6. RewriteRule ^/([0-9]+)_[^/]+/archive/([0-9]+)_[^.]+\.html$ /index.php?op=ViewArticle&blogId=$1&articleId=$2 [L,NC]
  7.  
  8. # Monthly archive (i.e. /plog/1_userfoo/archive/200401.html)
  9. RewriteRule ^/([0-9]+)_[^/]+/archive/([0-9]{6})\.html$ /index.php?blogId=$1&Date=$2 [L,NC]
  10.  
  11. # Daily archive (i.e. /plog/1_blogfoo/archive/20040101.html)
  12. RewriteRule ^/([0-9]+)_[^/]+/archive/([0-9]{8})\.html$ /index.php?blogId=$1&Date=$2 [L,NC]
  13.  
  14. # Album (i.e. /plog/88_userfoo/albums/34_title-foo-bar.html)
  15. RewriteRule ^/([0-9]+)_[^/]+/albums/([0-9]+)_[^.]+\.html$ /index.php?op=ViewAlbum&blogId=$1&albumId=$2 [L,NC]
  16.  
  17. # Albums (i.e. /plog/88_userfoo/albums/)
  18. RewriteRule ^/([0-9]+)_[^/]+/albums/$ /index.php?op=ViewAlbum&blogId=$1&albumId=0 [L,NC]
  19.  
  20. # Category view (i.e. /plog/88_userfoo/categories/4_cat-foobar.html)
  21. RewriteRule ^/([0-9]+)_[^/]+/categories/([0-9]+)_[^.]+\.html$ /index.php?blogId=$1&postCategoryId=$2 [L,NC]
  22.  
  23. # Category-Feeds (i.e. /plog/3_userfoo/feeds/categories/2_category/atom)
  24. RewriteRule ^/([0-9]+)_[^/]+/feeds/categories/([0-9]+)_[^.]+/(.*)$ /rss.php?blogId=$1&categoryId=$2&profile=$3 [L,NC]
  25.  
  26. # Feeds (i.e. /plog/3_userfoo/feeds/atom)
  27. RewriteRule ^/([0-9]+)_[^/]+/feeds/(.*)$ /rss.php?blogId=$1&profile=$2 [L,NC]
  28.  
  29. # Trackbacks (i.e. /plog/3_userfoo/trackbacks/34_title-foo-bar.html)
  30. RewriteRule ^/([0-9]+)_[^/]+/trackbacks/([0-9]+)_[^.]+\.html$ /index.php?op=Trackbacks&blogId=$1&articleId=$2 [L,NC]
  31.  
  32. # Comment form (i.e. /plog/88_userfoo/comment/34_title-foo-bar.html)
  33. RewriteRule ^/([0-9]+)_[^/]+/comment/([0-9]+)_[^.]+\.html$ /index.php?op=Comment&blogId=$1&articleId=$2 [L,NC]
  34.  
  35. # Resources (i.e. /plog/88_userfoo/resources/this-is-a-resource-name.pdf.html)
  36. RewriteRule ^/([0-9]+)_[^/]+/resources/([^.]+)\.([^.]+)\.html$ /index.php?op=ViewResource&blogId=$1&resource=$2.$3 [L,NC]
  37.  
  38. # Download a resource (i.e. /plog/88_userfoo/get/this-is-a-resource-name.pdf)
  39. RewriteRule ^/([0-9]+)_[^/]+/get/(.+)$ /resserver.php?blogId=$1&resource=$2 [L,NC]
  40.  
  41. # Static Pages (i.e /plog/3_userfoo/demosites)
  42. RewriteRule ^/([0-9]+)_[^/]+/(.+)$ /index.php?op=Template&blogId=$1&show=$2 [NC]
  43.  
  44. # A non-default blog (i.e. /plog/88_userfoo)
  45. RewriteRule ^/([0-9]+)(_[^/]+)?$ /index.php?blogId=$1 [L,NC]
  46.  
  47. # Daily archive (i.e. /plog/1_userfoo/archive/20040101.html)
  48. RewriteRule ^/([0-9]+)_[^/]+/archive/([0-9]{8})\.html$ /index.php?blogId=$1&Date=$2 [L,NC]
  49. ##############################

4. 如果你安裝在子目錄,例如 www.mysite.com/blog/,記得要把每一行 Rewrite 的規則都修正為

  1. RewriteRule ^/blog/([0-9]+)_[^/]+/archive/([0-9]+)_[^.]+\.html$ /blog/index.php?op=ViewArticle&blogId=$1&articleId=$2 [L,NC]

哪裡不同呢?仔細看,有看到嗎?每一行 Rewrite 的規則前面與中間都多了 /blog 這個子目錄喔!

全文出處:IIS & Mod_Rewrite - How to get it working


我在 IIS 下已經成功安裝 LifeType 了,可是每次登出時都出現 Exception message: session_destroy(): Session object destruction failed,這是什麼問題呢?

那是因為 IUSER 對 php session 的資料目錄只有寫入權限,而沒有修改權限所造成的。

請用 phpinfo() 查出你的 session 目錄,並且到 IIS 設定中設定 guest 對那個目錄的權限是可讀寫以及修改。