Solution to the problem that the image of the dedecms dream system's backend verification code is not displayed

Source: Internet
Author: User

After the website is migrated, The dedecms dream system background Verification Code image is not displayed.
General Solution-cancel the background Verification Code Function
Because there is no verification code, you cannot enter the background, So modify the PHP file source code:
Method 1:
Open Dede/login. php and find the following code:
If ($ validate = ''| $ validate! = $ Svali) & preg_match ("/6/", $ safe_gdopen )){
Resetvdvalue ();
Showmsg ('verification code is incorrect! ', 'Login. php );
Exit;
}
Replace the first line
If (false ){
Solve the problem. directly go to the background without entering the verification code.

Method 2:

Open Data/safe/Inc. Safe. config. php
Delete 6 from code $ safe_gdopen = '1, 2, 3, 4, 5, 6, 7 ';.
Dede background Verification Code not shown in Case 1 Analysis
The Verification Code requires the GD library. Check whether the GD library is enabled in your environment.


Appendix: Dede background Verification Code only displays the background, but does not display letters.

Open the verification code generation File Include/vdimgck. php
Find
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];
}
If the imagettftext () function is not successfully executed, the Verification Code only displays the background without letters. The specific cause is that the font file path is incorrect.
Solution:
1. Check whether the include/data/fonts/contains a font file. The default value is ggbi. TTF.
2. Add the following code to the line for ($ I = 0; $ I <$ rndcodelen; $ I ++:
$ Font_file = str_replace ("\", "/", $ font_file );
Replace the backslash in the font file path with the slash, because we know that the backslash has the function of translating characters, and the $ font_file path is generally a drive letter: the \ appserv \ WWW system uses the backslash as an escape character. As a result, $ font_file is not a path, so the imagettftext () function always returns an error.
Add $ font_file = str_replace ("\", "/", $ font_file.

Dede background verification code is not displayed. Case 2
The include/data/words/words.txt file does not exist.
Solution:
1. Copy one.
2. Find the code.
'Word _ type' => (INT) $ safe_codetype, // 1: Number 2: English 3: Word
Replace it with 'word _ type' => 1, (or 2). The verification code is a number or an English

If it can be displayed and then the verification code is canceled, you can try overwriting the data and include directories.

Close the job.

solution to the problem where the image of the background Verification Code of dedecms dream system is not displayed

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.