DEDECMS search blank problem solution

Source: Internet
Author: User

Recently, a customer switched dedecms from the WINDOWS2003 environment to the LINUX environment. This is no problem, but the customer's search function cannot be used.
Enter a keyword and search. A blank area is displayed.
 

At the beginning, I thought it was a permission issue. I set all the folders to 777, and the results are still the same. I 'd like to change the template to an official built-in template. The results are still blank.
After eliminating these two problems, the rest is intriguing. I don't know where the error is, so I started Baidu.
 
Most of the people mentioned on the official website go to the backend and close the Sphinx Search Server in other settings. The problem is that the customer did not take the root of the problem.
So where is the error? I think the most likely error is/plus/search. php. Download the official source code and overwrite it again!
So what code is written, which is incompatible with the LINUX environment?
 
Well, I have talked about so many ideas, and now I want to explain the solution.
In fact, it is quite simple. Although I do not know why, I only need to go to the root directory/plus/search. php to edit this file and delete the following code.

 

The code is as follows: Copy code
// Query topic information
If (empty ($ typeid ))
{
$ TypenameCacheFile = DEDEDATA. '/cache/typename. inc ';
If (! File_exists ($ typenameCacheFile) | filemtime ($ typenameCacheFile) <time ()-(3600*24 ))
{
$ Fp = fopen (DEDEDATA. '/cache/typename. inc', 'w ');
Fwrite ($ fp, "<"."? Php \ r \ n ");
$ Dsql-> SetQuery ("Select id, typename, channeltype From '#@__ arctype '");
$ Dsql-> Execute ();
While ($ row = $ dsql-> GetArray ())
{
Fwrite ($ fp, "\ $ typeArr [{$ row ['id']}] = '{$ row ['typename']}'; \ r \ n ");
}
Fwrite ($ fp ,'? '.'> ');
Fclose ($ fp );
}
// Introduce the column cache and check whether the keyword contains related column content
Require_once ($ typenameCacheFile );
If (isset ($ typeArr) & is_array ($ typeArr ))
{
Foreach ($ typeArr as $ id => $ typename)
{
// $ Keywordn = str_replace ($ typename, '', $ keyword );
$ Keywordn = $ keyword;
If ($ keyword! = $ Keywordn)
{
$ Keyword = HtmlReplace ($ keywordn );
$ Typeid = intval ($ id );
Break;
}
}
}
}

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.