常见服务器和软件故障及解决方法,故障解决方法


一、织梦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.ttf

2在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 library
into the system, or build the OpenSSL library statically from the source
with 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 4
make[1]: *** [sql/CMakeFiles/sql.dir/all] Error 2
make: *** [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)
    ;;
esac

true

记得没有修改这个文件,好像只修改了~/.bashrc这个参数,然后就出现了vte.sh__vte_prompt_command的提示。通过执行source /etc/profile.d/vte.sh即可解决上面的问题,也可把source /etc/profile.d/vte.sh 加入到 ~/.bashrc里面,再执行一下source ~/.bashrc就行了。


<

相关内容