常見伺服器和軟體故障及解決方案,故障解決方案
一、織夢Dede後台驗證碼不顯示解決方案
織夢Dede後台驗證碼不顯示解決方案,很多時候dedecms網站背景驗證碼不顯示,驗證碼不顯示網站後台就沒法登陸,常見的驗證碼後台不顯示的情況有以下三種:
Dede後台驗證碼不顯示情況一:
Dede後台驗證碼不顯示情況二:
Dede後台驗證碼不顯示情況三
那麼以上三種方法我們應該如何解決織夢Dede後台驗證碼不顯示?
通用解決方案---取消後台驗證碼功能
因為沒有驗證碼 不能進後台 所以修改php檔案原始碼:
方法一:
開啟dede/login.php找到如下代碼
if(($validate=='' || $validate != $svali) && preg_match("/6/",$safe_gdopen)){ ResetVdValue(); ShowMsg('驗證碼不正確!','login.php',0,1000); exit;}第一行替換為 if(false){
好 問題解決 不輸驗證碼,後台直接進去!!!
方法二:
開啟data/safe/inc.safe.config.php
把代碼$safe_gdopen = '1,2,3,4,5,6,7'; 中的6,刪除即可
Dede後台驗證碼不顯示情況1分析:
驗證碼需要GD庫 請檢查你的環境是否開啟GD庫
Dede後台驗證碼不顯示情況2分析:
驗證碼只顯示背景 不顯示字母
開啟驗證碼組建檔案 Include/vdimgck.php
找到
for($i=0;$i<$rndcodelen;$i++) { $bc = mt_rand(0, 1); $rndstring[$i] = strtoupper($rndstring[$i]); $c_fontColor = $fontColor[mt_rand(0,4)]; $y_pos = $i==0 4 : $i*($font_size+2); $c = mt_rand(0, 15); @imagettftext($im, $font_size, $c, $y_pos, 19, $c_fontColor, $font_file,$rndstring[$i]); $lastc = $rndstring[$i];}
Imagettftext()函數沒有成功的執行導致了驗證碼只顯示背景 不顯示字母
具體原因為 字型檔路徑不對.解決方案
1確認include/data/fonts/ 裡面存在字型檔 預設為ggbi.ttf2在for($i=0;$i<$rndcodelen;$i++)上一行 加上如下代碼: $font_file= str_replace("\\","/",$font_file);
即 把字型檔路徑中反斜線替換成斜杠 因為我們知道反斜線有轉譯字元的功能,
$font_file 路經大體為 盤符:\appserv\www 系統錯誤的把反斜線當作轉義用了 導致$font_file也就不是一個路徑了 所以Imagettftext()函數總是返回錯誤
加上$font_file=str_replace("\\","/",$font_file);即可解決
Dede後台驗證碼不顯示情況3分析:
Include/data/words/words.txt檔案不存在
解決方案1 拷貝一個進去解決方案2找到代碼 'word_type' =>(int)$safe_codetype, // 1:數字 2:英文 3:單詞 換成'word_type' =>1 (或2) 既驗證碼為數字或英文
Dede後台驗證碼不顯示 全部情況解決如果原來可以顯示後來取消驗證碼後再設定就無法顯示,可以通過覆蓋data與include目錄試試!!!
二、編譯mysql出現CMakeError atcmake/readline.cmake:83 (MESSAGE)
-- Could NOT find Curses (missing: CURSES_LIBRARY CURSES_INCLUDE_PATH)CMake Error at cmake/readline.cmake:83 (MESSAGE): Curses library not found. Please install appropriate package, remove CMakeCache.txt and rerun cmake.On Debian/Ubuntu, package name is libncurses5-dev, on Redhat and derivates it is ncurses-devel.Call Stack (most recent call first): cmake/readline.cmake:127 (FIND_CURSES) cmake/readline.cmake:217 (MYSQL_USE_BUNDLED_LIBEDIT) CMakeLists.txt:257 (MYSQL_CHECK_READLINE) -- Configuring incomplete, errors occurred!
該報錯原因是未安裝ncurses-devel,運行下面命令
第一步:安裝#yum -y install ncurses-devel第二步:刪除CMakeCache.txt通過find命令找到所有CMakeCache.txt文檔的位置#find / -name CMakeCache.txt然後全部刪除:# rm -rf/usr/local/src/cmake-2.8.6/Tests/Complex/Cache/CMakeCache.txt# rm -rf/usr/local/src/cmake-2.8.6/Tests/ComplexOneConfig/Cache/CMakeCache.txt# rm -rf/usr/local/src/cmake-2.8.6/Tests/ComplexRelativePaths/Cache/CMakeCache.txt# rm -rf/usr/local/src/mysql-5.5.18/CMakeCache.txt。。。。。。。全部刪除後再重新cmake就OK了。
三、配置Nginx服務出錯
./configure: error: SSL modules require the OpenSSL library.You can either do not enable the modules, or install the OpenSSL libraryinto the system, or build the OpenSSL library statically from the sourcewith nginx by using --with-openssl= option.
解決如下:
yum-yinstallopensslopenssl-devel
再執行./configure即可
四、.虛擬記憶體報錯c++: internal compilererror: Killed
(program cc1plus)
c++: internal compiler error: Killed (program cc1plus)Please submit a full bug report,with preprocessed source if appropriate.See for instructions.make[2]: *** [sql/CMakeFiles/sql.dir/item_geofunc.cc.o] Error 4make[1]: *** [sql/CMakeFiles/sql.dir/all] Error 2make: *** [all] Error 2
解決方案:
增加記憶體;增加虛擬記憶體
五、bash:__vte_prompt_command: command not found解決辦法
今天不知道做什麼操作,只要運行命令就會出現bash: __vte_prompt_command: command not found的提示,根據網上的資料,找到了__vte_prompt_command的出處,即/etc/profile.d,其內容如下
# Copyright 2006 Shaun McCance # Copyright 2013 Peter De Wachter ## This program is free software: you can redistribute it and/or modify# it under the terms of the GNU General Public License as published by# the Free Software Foundation, either version 3 of the License, or# (at your option) any later version.## This program is distributed in the hope that it will be useful,# but WITHOUT ANY WARRANTY; without even the implied warranty of# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the# GNU General Public License for more details.## You should have received a copy of the GNU General Public License# along with this program. If not, see .# Not bash or zsh[ -n "$BASH_VERSION" -o -n "$ZSH_VERSION" ] || return 0# Not an interactive shell[[ $- == *i* ]] || return 0# Not running under vte[ "${VTE_VERSION:-0}" -ge 3405 ] || return 0__vte_urlencode() ( # This is important to make sure string manipulation is handled # byte-by-byte. LC_ALL=C str="$1" while [ -n "$str" ]; do safe="${str%%[!a-zA-Z0-9/:_\.\-\!\'\(\)~]*}" printf "%s" "$safe" str="${str#"$safe"}" if [ -n "$str" ]; then printf "%%%02X" "'$str" str="${str#}" fi done)# Print a warning so that anyone who's added this manually to his PS1 can adapt.# The function will be removed in a later version.__vte_ps1() { echo -n "(__vte_ps1 is obsolete)"}__vte_osc7 () { printf "\033]7;file://%s%s\a" "${HOSTNAME:-}" "$(__vte_urlencode "${PWD}")"}__vte_prompt_command() { local pwd='~' [ "$PWD" != "$HOME" ] && pwd=${PWD/#$HOME\//\~\/} printf "\033]0;%s@%s:%s\007%s" "${USER}" "${HOSTNAME%%.*}" "${pwd}" "$(__vte_osc7)"}case "$TERM" in xterm*|vte*) [ -n "$BASH_VERSION" ] && PROMPT_COMMAND="__vte_prompt_command" [ -n "$ZSH_VERSION" ] && precmd_functions+=(__vte_osc7) ;;esactrue
記得沒有修改這個檔案,好像只修改了~/.bashrc這個參數,然後就出現了vte.sh__vte_prompt_command的提示。通過執行source /etc/profile.d/vte.sh即可解決上面的問題,也可把source /etc/profile.d/vte.sh 加入到 ~/.bashrc裡面,再執行一下source ~/.bashrc就行了。
<