为了安全,我们可以将DEDECMS站点data目录移到上一级目录,或者改为其他名字。
注:DedeCMS v5.7 sp1不需要以上操作,这一点官方已升级调整过了。
如果按照这篇文档里操作之后,验证码不显示,说明有一个地方,你还没有调整:
打开include下的vdimgck.php, 找到如下代码:
- require_once (diame(__FILE__).'/../data/safe/inc_safe_config.php');
- require_once (diame(__FILE__).'/../data/config.cache.inc.php');
- $config = array(
- 'font_size' => 14,
- 'img_height' => $safe_wheight,
- 'word_type' => (int)$safe_codetype, // 1:数字 2:英文 3:单词
- 'img_width' => $safe_wwidth,
- 'use_boder' => TRUE,
- 'font_file' => diame(__FILE__).'/data/fonts/ggbi.ttf',
- 'wordlist_file' => diame(__FILE__).'/data/words/words.txt',
- 'filter_type' => 5);
- $sessSavePath = diame(__FILE__)."/../data/sessions/";
将上面代码中的data路径做相应的调整,比如上面3步操作是将data移到根目录的上一级目录,我们这里对data的路径加一个“/..”,改后如下:
- require_once (diame(__FILE__).'/../../data/safe/inc_safe_config.php');
- require_once (diame(__FILE__).'/../../data/config.cache.inc.php');
- $config = array(
- 'font_size' => 14,
- 'img_height' => $safe_wheight,
- 'word_type' => (int)$safe_codetype, // 1:数字 2:英文 3:单词
- 'img_width' => $safe_wwidth,
- 'use_boder' => TRUE,
- 'font_file' => diame(__FILE__).'/data/fonts/ggbi.ttf',
- 'wordlist_file' => diame(__FILE__).'/data/words/words.txt',
- 'filter_type' => 5);
- $sessSavePath = diame(__FILE__)."/../../data/sessions/";
好了,这样就可以了。
一起学吧部分文章转载自互联网,供读者交流和学习,若有涉及作者版权等问题请及时与我们联系,以便更正、删除或按规定办理。感谢所有提供资讯的网站,欢迎各类媒体与一起学吧进行文章共享合作。