如果是設定discuz,其實可以比照設定就可以解決。
其他的改法:
如果已經有翻過google,查詢過 discuz 404 設置方式。
其中有一種設定方式是:
今天來介紹discuz的一個插件就能處理個狀況:
discuz Open Graph 插件安裝(下列說明,以discuz! x3.2為準):
1.管理員登入discuz > 管理中心 > 應用 > 應用中心 >搜索: open graph
2. 搜索完成後,點進 open graph。
3. 確定版本有支援,在點下安裝應用。
4.記得到插件列表,啟動插件。
如果安裝完成後,當使用FB的分享文章功能,還是看不到自動抓圖,
或用facebook 除錯網站 也是異常,恐怕是和其他插件衝到,
也有最極端的狀況是,網址被facebook列為黑名單引起。
(本篇教學由unethost.com客服撰寫)
延伸閱讀:如何備份Cpanel後台安裝的套裝程式?
安裝上述的軟體,我們提供虛擬主機試用,七天滿意保證,
功能完整使用不受限制,歡迎點我申請。
以下舉disucz! x3.2為例:
1.確定論壇及ucenter都可以登入,
但是管理員要登入管理中心後, 只是出現一片空白。
2.這種原因,大約都是安裝到錯誤的插件引起的,
導致code被寫壞,而產生這個狀況。
3.可以先用乾淨版的主程式,
路逕是 source/admincp 去蓋過網站上的,通常就可以恢復了。
4.如果還是異常,恐怕是資料庫也被寫爛引起,
就要考慮還原資料庫了。
大多數套裝軟體的異常,
也可以靠這招就是覆蓋原始檔程式去復原。
(本篇教學由unethost.com客服撰寫)
延伸閱讀:如何備份Cpanel後台安裝的套裝程式?
安裝上述的軟體,我們提供虛擬主機試用,七天滿意保證,
功能完整使用不受限制,歡迎點我申請。
]]>
所以在設置 gmail smtp 寄信,
得分別設定這兩樣系統,否則會有意想不到的錯誤發生。
以下舉 discuz! x3.2 utf8 繁體版為例:
關於discuz主程式的部份:
1.管理中心 > 站長 > 郵件設置
特別需要注意的是,用 gmail ssl 會比較穩定些,
所以設置的路逕就是:
SMTP 服務器 ssl://smtp.gmail.com
端口:465
其他部份,請參考我們截圖即可。
2.設置完成後,在到檢測測試看看,
寄出後可以收到信,就表示設定成功了,
除非server擋到ssl port,否則通常都沒什麼問題。
3.gmail第一次寄信,一定得要切換:
低安全性應用程式功能
關於ucenter會員管理部份:
4.如果只是設定好discuz後台,還並非完成設置,
因為disczu後台是站內信通知用的,
會員註冊信則是在ucenter裡面。
5.所以在到 ucenter > 郵件設置 作smtp設定。
所以當會員註冊驗證信也要改用smtp寄信時,
切記得要在到ucenter設定一次。
改用smtp寄信的優點是,比較不會被當spam而被拒收,
請參考我們這一篇:連續寄信給yahoo信箱,被判斷是廣告信 (smtp設置精選)
(本篇教學由unethost.com客服撰寫)
延伸閱讀:如何備份Cpanel後台安裝的套裝程式?
安裝上述的軟體,我們提供虛擬主機試用,七天滿意保證,
功能完整使用不受限制,歡迎點我申請。
]]>
我們這邊提供快速解決方式。
其他discuz的問題,歡迎參考我們之前的文章。
需要先排除以下問題,方能快速解決:
1.近期是否有安裝過新的插件?
2.是否有改過版模?
3.空間容量是否暴滿?
4.有沒有改過檔案屬性?
5.其他檔案是否有改過?
如果以上皆否,這樣只要去檢查discuz的快取檔案即可。
如何開始?
1.登入ftp。
2.進入 /public_html/forumdata (public_html 為我們虛擬主機的路逕)。
3.底下有兩個資料夾,分別是 cache 及 templates。
4.通常只要把兩個資料夾先改掉,在重新新增兩個一樣名稱的資料夾,
在回到瀏覽器做F5更新頁面後,論壇就有80%機會恢復正常。
5.如果ucenter可以登入,也可以直接執行”更新緩存”功能,
也會有一樣的效果。
我們這一次遇到舊版的discuz,並未使用ucenter,
另一部份,也可以使用discuz tools.php修復,
只是我們自己熟練的步驟,是用第4步來解決最快。
最後還需要注意的是:
6.這個還有php handle的問題,
dso模式,需要將資料夾和檔案改為777才會正常。
fastcgi則為755,檔案就不需要變更。
7.舊的資料夾不要任意砍掉,因為有些版模是直接去改,
最後需要將檔案搬回去,一但砍掉,新的快取檔,
會讓版面秀斗。
(本篇教學由unethost.com客服撰寫)
延伸閱讀:如何備份Cpanel後台安裝的套裝程式?
安裝上述的軟體,我們提供虛擬主機試用,七天滿意保證,
功能完整使用不受限制,歡迎點我申請。
]]>
這幾天因協助移機,又接觸到discuz這一套論壇程式。
discuz 因為新版本更新及維護,程式現在是越來越肥,
加上語系編碼等問題,操作上如果沒狀況就沒問題,
一但出現問題就會相當棘手(主要是透過網站搜索不到解法)。
本次的狀況:
首先先了解一下,discuz現在是由discuz+ucenter所組成,
discuz是負責論壇主要功能;ucenter則是負責管理會員資料;
各有各的設定檔(config.php)。
當搬好網站後,透過管理員可以登入論壇,在去操作基本功能都沒問題,
本來這樣移機就會告一段落。
但是一般會員登入就出現問題了,登入會失敗;
就要重新確認是不是資料不齊全引起的?
網上找到的解法:
google搜索後,找到 http://www.discuz.net/thread-2982464-1-1.html
透過測試discuz 和 ucenter 通訊的解法,並重新修改了uc key,確定兩邊可以串接,
不過會員登入的問題還是無解。
窮測法:
請站長提供無法登入的帳號,並且透過論壇後台搜索,
1.確認過該帳號是存在的。
2.並去重新修改密碼試試,
結果在修改密碼後,跑出了錯誤訊息,提示是資料庫寫入異常。
最後解法:
根據錯誤訊息,就把除錯範圍縮小許多;
在discuz(及ucenter)的設計裡,任何內容寫入資料庫時,
都要透過設定檔去連結資料庫。
我們仔細去比對 discuz和ucenter的設定檔,
發現ucenter有一行異常,這一行原預設是:
define(‘UC_DBCHARSET’, ‘gbk’);,異常為
define(‘UC_DBCHARSET’, ‘utf8’);
後來將 utf8 改成 gbk,會員登入立即正常。
結論:
這個utf8的問題,是因為在搬移論壇時,其舊主機無法使用phpmyadmin
去匯出資料庫,舊主機php版本為5.2 mysql版本是 5.5,
導致現有phpmyadmin都無法相容。
我們的作法是,
1.改以論壇後台備份資料庫。
2.在透過論壇去還原。
中間過程中,我們需要重新安裝一套discuz,因用到不同版本語系,
才出現這個狀況,所以未來如果要操作類似的狀況,
請記得務必使用相同版本及語系,以免出現編碼問題。
另外新安裝者,建議都用utf8版,這樣也可以將編碼問題減到最少。
(本篇教學由unethost.com客服撰寫)
延伸閱讀:如何備份Cpanel後台安裝的套裝程式?
安裝上述的軟體,我們提供虛擬主機試用,七天滿意保證,
功能完整使用不受限制,歡迎點我申請。
]]>
discuz php5.4的問題,根據discuz論壇提供的資料 http://www.discuz.net/thread-3095848-1-1.html
原來是 discuz 本身的程式碼,只有相容於 ISO-8859-1 ,所以php 5.3 之前的版本都沒有問題,php 5.4 則是使用 utf8 ,則會因此導致使用到ISO-8859-1編碼的功能出錯。
— Begin opt ‘Deflate’ —
— Begin step ‘to config options’ —
— End step ‘to config options’ —
— End opt ‘Deflate’ —
— Begin opt ‘Expires’ —
— Begin step ‘to config options’ —
— End step ‘to config options’ —
— End opt ‘Expires’ —
— Begin opt ‘Mod FastCGI v2.3.9’ —
— Begin dryrun test ‘Store FCGID working directory’ —
— End dryrun test ‘Store FCGID working directory’ —
— Begin dryrun test ‘Patch mod_fcgid’ —
Patch tested at -p1; ../mod_fcgid_patches/0001-only_signal_running.patch
Applying patch; ../mod_fcgid_patches/0001-only_signal_running.patch
patching file modules/fcgid/fcgid_proc_unix.c
Hunk #1 succeeded at 417 (offset -5 lines).
— End dryrun test ‘Patch mod_fcgid’ —
— Begin step ‘Create task list to do after apache is built’ —
— End step ‘Create task list to do after apache is built’ —
— End opt ‘Mod FastCGI v2.3.9’ —
— Begin opt ‘Fileprotect’ —
— Begin dryrun test ‘turning it on…’ —
— End dryrun test ‘turning it on…’ —
— Begin step ‘Run /usr/local/cpanel/scripts/enablefileprotect after Apache is installed’ —
— End step ‘Run /usr/local/cpanel/scripts/enablefileprotect after Apache is installed’ —
— End opt ‘Fileprotect’ —
— Begin opt ‘Headers’ —
— Begin step ‘to config options’ —
— End step ‘to config options’ —
— End opt ‘Headers’ —
— Begin opt ‘MPM Prefork’ —
— Begin step ‘to config options’ —
— End step ‘to config options’ —
— End opt ‘MPM Prefork’ —
— Begin opt ‘MemCache’ —
— Begin step ‘to config options’ —
— End step ‘to config options’ —
— End opt ‘MemCache’ —
— Begin opt ‘Proxy’ —
— Begin step ‘Adding –enable-proxy to Apache configure line’ —
— End step ‘Adding –enable-proxy to Apache configure line’ —
— End opt ‘Proxy’ —
— Begin opt ‘UniqueId’ —
— Begin step ‘Applying EasyApache patches’ —
Patch tested at -p1; /home/cpeasyapache/src/cppatch/0001-Provided-a-fallback-for-mod_unique_id-when-hostname-.patch
Applying patch; /home/cpeasyapache/src/cppatch/0001-Provided-a-fallback-for-mod_unique_id-when-hostname-.patch
patching file modules/metadata/mod_unique_id.c
— End step ‘Applying EasyApache patches’ —
— Begin step ‘to config options’ —
— End step ‘to config options’ —
— End opt ‘UniqueId’ —
— Begin opt ‘Apache 2.2’ —
— Begin dryrun test ‘Applying patches if any’ —
Patch tested at -p1; ../cppatch/2.2.6-ssl_engine_rand.patch
Applying patch; ../cppatch/2.2.6-ssl_engine_rand.patch
patching file modules/ssl/ssl_engine_rand.c
Patch tested at -p1; ../cppatch/2.2.8_ssl_scache_dbm.patch
Applying patch; ../cppatch/2.2.8_ssl_scache_dbm.p
4. 掃了一下log,看到的確也有擺放 source template 的位置,大約是在 /var/cpanel/ ,
但不太確定,只好在多看幾行, 又看到 ../cppatch,在 locate cppatch 真實的路逕,
在去vim 數個xxx.path , 看到了在 /var/cpanel/perl/easy/Cpanel/Easy/PHP5/ 。
5. cd /var/cpanel/perl/easy/Cpanel/Easy/PHP5 後,在仔細看一下資料夾內的資料, 發現了 4_34.pm.tar.gz ,解開這個壓縮檔, ext/standard/html.c 果然躲在這裡,
修改完,在使用 easyapache compile ….. finish 。
================================================================
以上是透過主機的解法。 另快也可以透過修改程式去解決(比較能一勞永逸)
1. php的官方網站,也有列出這樣的問題,以及大約要修改的語法:
http://php.net/manual/en/function.htmlspecialchars.php
2. php 官方真是相當地體貼, 把內容及除錯的方式都寫的很清楚(也就是強制讓語法使用
ISO-8859-1) :
As of PHP 5.4 they changed default encoding from “ISO-8859-1” to “UTF-8”. So if you get null from htmlspecialchars or htmlentities
where you have only set
<?php
echo htmlspecialchars($string);
echo htmlentities($string);
?>
you can fix it by
<?php
echo htmlspecialchars($string, ENT_COMPAT,‘ISO-8859-1’, true);
echo htmlentities($string, ENT_COMPAT,‘ISO-8859-1’, true);
?>
3. 在linux 底下,用 grep 就可以快速找出有問題的地方:
On linux you can find the scripts you need to fix by
grep -Rl “htmlspecialchars\\|htmlentities” /path/to/php/scripts/
================================================
以上是我們的處理心得,希望也能解決你的問題!!
]]>以下是使用說明:
3. 點下 install this application 。
4. 可修改[Domain]及[安裝路逕],其他部份請保持預設,填入後,在點右下角的[搜索]。
5.安裝完後,會提示詳細路逕。請在將該路逕,貼到瀏覽器上。
6. 貼到瀏覽器後,會提示錯誤訊息,這是因為安裝尚未完成,請在路逕後在加上 /install 。
10. 資料庫相關資料,已經自動填妥,請在自行填入論壇管理員資料。並點下一步。
12.去掉/install,在回到首頁,錯誤訊息已不見了,論壇也安裝完成,並可使用。
這樣的安裝方式,在unethost.com虛擬主機裡功能裡都已有設定好,請大家試試看。
]]>我們一查php生成的error檔,看到的訊息是:
PHP Fatal error: Call to undefined function imagettftext()
看來是有少php的library。這個imagettftext()所對應的php library,是GD和freetype這兩個。所以解決之道就是:
一旦成功了,圖形驗証碼就出來了。
]]>