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; } } } }
|