How to solve the problem that DEDECMS cannot log on to the background

Source: Internet
Author: User
Tags sessions browser cache
DedeCms is well known for its simplicity, practicality, and open source. DedeCms is the most well-known PHP open source website management system in China and the most popular php cms system, after years of development, the current version has made great strides in terms of functionality and ease of use. The main target users of the DedeCms free version are locked in the personal webmaster, the function is more focused on the construction of personal websites or small and medium-sized portals. Of course, there are also enterprise users and schools who are using the system. However, many people find that cms runs well on their local computers. Why is it wrong when it is migrated to the server?

 

This is mainly caused by environment and configuration problems. The Login error in the dream background is a typical error.

 

 

There are several important points in the solution to this error. Generally, the installation requirements of the dream environment are php + mysql + apache. The first problem is generally the PHP version.

 

(1) change the PHP version

 

If an error occurs in your dream background, manually switch the PHP version in your host control panel to 5.4. Here I am using the cpanel control panel of host 91.

 

 

It is worth noting that most versions 5.4 do not have the session_register function. So here we need to manually add it.

 

It's easy to add the following code to include/userlogin. class. php:

 

Functionsession_register (){

 

$ Args = func_get_args ();

 

Foreach ($ argsas $ key ){

 

$ _ SESSION [$ key] = $ GLOBALS [$ key];

 

}

 

}

 

(2) modify folder permissions

 

The reason why the verification code cannot be displayed and automatically logged out is that the write permission for the sessions folder under the date folder and date does not exist!

 

Sessions is a folder for recording (transfer) login information. It cannot generate files, and naturally it cannot log in and jump back.

 

The solution is as follows:

 

Modify the permissions of the sessions folder under date and date (you can try to modify it on FLASHFXP, but it may cause failure)

 

Therefore, we recommend that you change the date and sessions permissions to 777 (writen) directly in the control panel of the host)

 

 

(3) reinstall cms

 

In this way, you need to know that most of the background problems are on the website file, so you only need to re-install the Zhimeng cms and then restore your database.


1. session problems
Check whether the datasessions folder of the space has the write permission. The parameters of each login session are saved in the session generated under this folder.
File sess_dc9d7a2f6d6125ab681dcbafff123456 the background of each session file will determine whether you are logged on.
If you have the write permission, a new file is generated during login to view the file date.
If no new file is generated, the folder has no write permission. Grant the write permission to the folder.
If you have the write permission or cannot log in, clear the files in the sessions folder, log on again, and clear the browser cache.

2. Transfer the account password directly in the address bar (not recommended for beginners)
Enter the background address: localhost/dede/login. php? Dopost = login & userid = admin & pwd = admin
Just upload three parameters, dopost = login userid = Account, pwd = password


Blank


Today, I started to modify a dedecms-based website. I want to log on to its background management system. The address is domain/dede. The page is displayed as normal. There is no problem with the username and password input. The result is blank, unable to enter the background, so I began to find the problem.

I first found login. php under dede. After various breakpoints, I found 79 rows:

$ CuserLogin-> keepUser ();

There is a problem. $ cuserLogin is the object of the userLogin class. The userLogin class is located in userlogin. class. php in dedecms's include, and there is a sentence around 290 lines:


@ Session_register ($ this-> keepUserIDTag );

I removed the @ in front of the code, and the program's error finally came out. I checked the session_register method in the php Manual, which wrote a large Warning:

Warning

This function has been deprecated since PHP 5.3.0 and removed from PHP 5.4.0.

Okay! So it turns out! My php is exactly 5.4. How can this be done? I want to rewrite a session_register method!


Function session_register (){
$ Args = func_get_args ();
Foreach ($ args as $ key ){
$ _ SESSION [$ key] = $ GLOBALS [$ key];
    }
}

Write this code into userlogin. class. php. The background of dedecms is successfully logged in! I don't know when the dedecms official team will modify this bug?

Is it very simple? Of course, these are only part of it. There are still many questions about background login failures. I will not explain them here. Thank you.

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.