1. 程式人生 > >make &make install 時出現錯誤和警告的修正

make &make install 時出現錯誤和警告的修正

Aspseek1.4更新日誌

一、make && make install時出現的警告、錯誤及其修正

錯誤及警告:

charsets.cpp:475:1: warning: deprecated conversion from string constant to 'char*'

/usr/include/c++/4.5/backward/backward_warning.h:28:2: warning: #warning This file includes at least one

deprecated or antiquated header which may be removed without further notice at a future date. Please use a

non-deprecated interface with equivalent functionality instead. For a listing of replacement headers and

interfaces, consult the file backward_warning.h. To disable this warning use -Wno-deprecated.

../../include/maps.h:33:9: error: an explicit specialization must be preceded by 'template <>'

../../include/charsets.h:108:9: error: an explicit specialization must be preceded by 'template <>'

../../include/ucharset.h:439:10: error: 'str' was not declared in this scope

../../include/ucharset.h:476:9: error: an explicit specialization must be preceded by 'template <>'

../../include/ucharset.h:569:9: error: an explicit specialization must be preceded by 'template <>'

../../include/sqldb.h:238:10: warning: deprecated conversion from string constant to 'char*'

daemon.cpp:97:18: warning: deprecated conversion from string constant to ‘char*’

daemon.cpp: In function ‘int LoadDaemonConfig(const char*, int)’:

daemon.cpp:244:36: warning: deprecated conversion from string constant to ‘char*’

修正:

(1)warning: deprecated conversion from string constant to ‘char*’
isos編譯的時候,這個警告影響編譯通過。
解決方法:把 char * 改成 static const char * 的話這個 Warning 就不會出現了。

charsets.cpp :368 const char *sgml;

(2)../../include/charsets.h:108

107 namespace STL_EXT_NAMESPACE {

108 template<> struct hash<CWord> {

同類錯誤修改同理。

錯誤:

../include/charsets.h:93:38: error: 'strncpy' was not declared in this scope

../include/charsets.h:98:38: error: 'strncpy' was not declared in this scope

../include/charsets.h:103:36: error: 'strcmp' was not declared in this scope

../include/ucharset.h:187:33: error: 'memset' was not declared in this scope

../include/sock.h:58:9: error: an explicit specialization must be preceded by 'template <>'

aspseek.cpp:100:18: error: 'strlen' was not declared in this scope

aspseek.cpp:102:31: error: 'memcpy' was not declared in this scope

aspseek.cpp:114:25: error: 'memcpy' was not declared in this scope

aspseek.cpp:210:33: error: 'memset' was not declared in this scope

aspseek.cpp:220:18: error: 'strlen' was not declared in this scope

aspseek.cpp:222:31: error: 'memcpy' was not declared in this scope

aspseek.cpp:232:23: error: 'strlen' was not declared in this scope

aspseek.cpp:235:31: error: 'memcpy' was not declared in this scope

aspseek.cpp:247:25: error: 'memcpy' was not declared in this scope

同樣的錯誤省略不顯示了

修正: 

home/cyh/aspseek/include/charsets.h檔案中的

26 #include <string.h>

錯誤:

templates.cpp:520:29: error: invalid conversion from 'const char*' to 'char*'

templates.cpp:527:23: error: invalid conversion from 'const void*' to 'void*'

templates.cpp:527:23: error: initializing argument 1 of 'void* memcpy(void*, const void*, size_t)'

templates.cpp:528:11: error: assignment of read-only location '*(s + ((unsigned int)len))'

templates.cpp:529:16: error: invalid conversion from 'const char*' to 'char*'

templates.cpp:529:16: error: initializing argument 1 of 'char* CTag::ParseTag(char*)'

templates.cpp:556:29: error: invalid conversion from 'const char*' to 'char*'

templates.cpp:1219:31: error: invalid conversion from 'const char*' to 'char*'

templates.cpp:1291:30: error: invalid conversion from 'const char*' to 'char*'

filters.cpp:48:31: error: invalid conversion from ‘const char*’ to ‘char*’

修正:

(1)templates.cpp檔案中進行以下修改:

520 if (!(s =(char *) strchr(option,'>')))

1219 char* sp =(char *) strchr(psite, ' ');

1291 char* sp =(char *) strchr(px, ' ');

(2)/home/cyh/aspseek/src/filters.cpp檔案中進行以下修改:

48 char* pd =(char *) strrchr(param, '.');

錯誤:

/usr/include/stdlib.h:766:12: error: expected unqualified-id before ‘int’

/usr/include/stdlib.h:766:12: error: expected ‘)’ before ‘int’

/usr/include/stdlib.h:766:12: error: expected ‘)’ before ‘int’

/usr/include/c++/4.5/cstdlib:106:11: error: ‘::abs’ has not been declared

/usr/include/c++/4.5/bits/stl_algo.h:3172:26: error: expected unqualified-id before ‘(’ token

../include/filters.h:81:28: error: ‘strdup’ was not declared in this scope

修正:

(1)/include/filters.h檔案中進行以下修改:

28 #include <string.h>

(2)/home/cyh/aspseek/include/ misc.h檔案中進行以下修改:

58 #define MAX(a,b) ((a) > (b) ? (a) : (b))

60 #define MIN(a,b) ((a) < (b) ? (a) : (b))

62 #define ABS(a) ((a) >= 0 ? (a) : -(a))

錯誤:

aspseek.cpp:1291: 41: error: 'min' was not declared in this scope

datasource.cpp:817:66: error: 'min' was not declared in this scope

filters.cpp:176:37: error: ‘min’ was not declared in this scope

filters.cpp:222:37: error: ‘min’ was not declared in this scope

修正:

(1)aspseek.cpp檔案的1291行: res->last = MIN(nFirst, res->counts[2]);

(2)datasource.cpp檔案的817行: int read = m_socket.Recv(buf, MIN(len, (int) (sizeof(buf) - 1)));

其他同類錯誤的修改方法同上。

錯誤:

./include/resolve.h:121:42: error: ‘memset’ was not declared in this scope 

修正:

./include/resolve.h檔案中的26行: #include <string.h>

錯誤:

deltas.cpp:2407:47: error: ‘max’ was not declared in this scope

deltas.cpp:2451:40: error: ‘max’ was not declared in this scope

deltas.cpp: In member function ‘ULONG CBufferedFile::Read(void*, ULONG)’:

deltas.cpp:2595:18: error: lvalue required as left operand of assignment

deltas.cpp:2614:18: error: lvalue required as left operand of assignment

deltas.cpp:2650:18: error: lvalue required as left operand of assignment

deltas.cpp:2669:18: error: lvalue required as left operand of assignment

wcache.cpp:56:19: error: ‘min’ was not declared in this scope

wcache.cpp:790:32: error: ‘max’ was not declared in this scope

修正:

deltas.cpp檔案中的2407行: WORD* times = new WORD[MAX(numUrl, maxUrl + 1)];

/home/cyh/aspseek/src/deltas.cpp檔案中的2595行: buf =(void *)((char *)buf+ rd);

其他同類錯誤修改方法同上。

錯誤:

../include/content.h:50:9: error: an explicit specialization must be preceded by ‘template <>’

../include/stopwords.h:61:9: error: an explicit specialization must be preceded by ‘template <>’

../include/rank.h:138:9: error: an explicit specialization must be preceded by ‘template <>’

index.cpp:249:29: error: ‘min’ was not declared in this scope

修正:

../include/content.h檔案中的50行: template<> struct hash<CLangString>

index.cpp檔案中的249行: int c = MIN(prnk - rnk, 10);

其他同類錯誤修改方法同上。

錯誤:

misc.cpp:65:58: error: new declaration ‘char* strcasestr(const char*, const char*)

修正:

misc.h檔案中新增 #include<string.h>

註釋misc.h中的41行: // char *strcasestr(const char *haystack, const char *needle);

註釋misc.cpp檔案中65行: // char *strcasestr(const char *haystack, const char *needle)

錯誤:

mimeconv.cpp:64:26: error: ‘mkstemp’ was not declared in this scope

mimeconv.cpp:83:28: error: ‘mkstemp’ was not declared in this scope

mimeconv.cpp:103:21: error: ‘system’ was not declared in this scope

mimeconv.cpp:217:11: error: ‘exit’ was not declared in this scope

mimeconv.cpp:231:28: error: ‘system’ was not declared in this scope

mimeconv.cpp:231:29: error: ‘exit’ was not declared in this scope

修正:

在/home/cyh/aspseek/include/ mimeconv.h檔案中新增 #include <stdlib.h>

錯誤:

../include/affix.h:149:9: error: an explicit specialization must be preceded by ‘template <>’

../include/ccom.h:78:3: error: ‘IUnknown’ was not declared in this scope

../include/ccom.h:78:13: error: ‘pTemp’ was not declared in this scope

../include/ccom.h:142:11: error: ‘E_POINTER’ was not declared in this scope

../include/ccom.h:146:10: error: ‘S_OK’ was not declared in this scope

daemon.cpp:1370:38: error: invalid conversion from ‘const char*’ to ‘char*’

../include/ccom.h:103:3: error: ‘assert’ was not declared in this scope

修正:

../include/affix.h檔案中的149行: template<> struct hash<CSWord> {

錯誤:

../include/ccom.h:78: error: `IUnknown' was not declared in this scope

修正:

向ccom.h中複製以下程式碼:

#define S_OK 0

#define E_POINTER 0x80004003L

* IUnknown 介面 */

class IUnknown

{

public:

virtual unsigned int AddRef(void) = 0;

virtual unsigned int Release(void) = 0;

virtual bool QueryInterface( const char* InterfaceName, void ** ppInterface ) = 0;

};

錯誤:

streams.cpp:81:31: error: ‘min’ was not declared in this scope

search.cpp:171:32: error: ‘max’ was not declared in this scope

search.cpp:172:32: error: ‘min’ was not declared in this scope

search.cpp:179:45: error: ‘min’ was not declared in this scope

search.cpp:183:42: error: ‘max’ was not declared in this scope

search.cpp:385:47: error: ‘min’ was not declared in this scope

search.cpp:1378:46: error: ‘max’ was not declared in this scope

search.cpp:2544:38: error: ‘max’ was not declared in this scope

search.cpp:2545:50: error: ‘min’ was not declared in this scope

search.cpp:2572:43: error: ‘max’ was not declared in this scope

search.cpp:2573:53: error: ‘min’ was not declared in this scope

修正:

search.cpp檔案中進行以下修正:

171 mins = MAX(minsite, m_minSite);

172 maxs = MIN(maxsite, m_maxSite);

錯誤 :

urlfilter.cpp:47:39: error: ‘memcpy’ was not declared in this scope

acl.cpp:64:43: error: ‘memcpy’ was not declared in this scope

修正:

向urlfilter.h中新增: #include "string.h"

向acl.h中新增:#include "string.h"

二、執行postinstall時出現的錯誤及其修正

錯誤:

linux-lkkd:/home/cyh/aspseek # /usr/local/aspseek/sbin/aspseek-mysql-postinstall

密碼:

修正:

useradd aspseek

在root下執行:linux-lkkd:/home/cyh/aspseek # /usr/local/aspseek/sbin/aspseek-mysql-postinstall

三、執行index時出現的錯誤及其修正

錯誤:

執行命令:/usr/local/aspseek/sbin/index時

報錯:Don't run ./index with privileged user/group ID (UID < 11, GID < 11)

修正:

passwd aspseek 設定密碼

su aspseek 切換到使用者aspseek

錯誤:

Loading configuration from /usr/local/aspseek/etc/db.conf

Can't open charset table file tables/windows-1250.txt: No such file or directory

Charset windows-1250 has not been loaded

Charset iso-8859-1 has not been loaded

Can't open charset table file tables/iso8859-2.txt: No such file or directory

Charset iso-8859-6 has not been loaded

Charset gb2312 has not been loaded

Loading configuration from /usr/local/aspseek/etc/ucharset.conf

Loading configuration from /usr/local/aspseek/etc/stopwords.conf

Address of param: bfdc2100

段錯誤

修正:

註釋index.cpp檔案中的以下行:

298行 //long* ref = (long*)DBName1.data() - 2;

1299行 //*ref = 0x40000000;

錯誤:

Error loading config: Error: can't open config file '/usr/local/aspseek/etc/db.conf': Permission denied

修正:

(1)cp /usr/local/aspseek/lib/libmysqldb-1.3.0pre1.so /usr/lib/mysql

(2)向 /etc/ld.so.conf檔案中新增/usr/lib/mysql

(3)註釋index.cpp中的以下行:

1298 //long* ref = (long*)DBName1.data() - 2;

1299 //*ref = 0x40000000;

錯誤:

index: Can't create directory '/usr/local/aspseek/var/aspseek12': Permission denied

修正:

進入:/usr/local/aspseek中

使用:ls –l 檢視var資料夾的許可權

執行:chmod o+w var 修改var許可權

錯誤:

Error locking mutex(互斥): Invalid argument

修正:

108 CBuddyHeap m_heap; (原始碼為CbuddyHeap *m_heap)

116 // m_heap = NULL; (註釋該句)

249 wp.m_heap = m_heap; (原始碼為wp.m_heap=&m_heap)

執行make後出現的錯誤:

buddy.cpp:192:25: error: base operand of ‘->’ has non-pointer type ‘CBuddyHeap’

buddy.cpp:200:25: error: base operand of ‘->’ has non-pointer type ‘CBuddyHeap’

buddy.cpp:202:9: error: base operand of ‘->’ has non-pointer type ‘CBuddyHeap’

buddy.cpp:215:9: error: base operand of ‘->’ has non-pointer type ‘CBuddyHeap’

buddy.cpp: 215:9: error: base operand of ‘->’ has non-pointer type ‘CBuddyHeap’

修正:

/home/cyh/aspseek/src/ buddy.cpp中

192 m_data = (WORD*)m_heap.Alloc(0);

200 m_data = (WORD*)m_heap.AllocBytes(m_allocated * sizeof(WORD) << 1);

202 m_heap.FreeBytes(olddata, m_allocated * sizeof(WORD));

215 m_heap.FreeBytes(m_data, m_allocated * sizeof(WORD));

錯誤:

Adding URL: http://www.xjau.edu.cn

Can't resolve hostname www.xjau.edu.cn: A temporary error occurred on an authoritative name. Try again later。

修正:

Linux沒有聯網,網路連線使用host-only。

四、執行searchd(開始檢索)時的錯誤以及修改方法

錯誤:

Not Found

The requested URL /cgi-bin/s.cgi was not found on this server.

修正:

註釋/home/cyh/aspseek/src/deamon.cpp檔案中的

1338 //static long* ref = (long*)config_name.data() - 2;

1339 //*ref = 0x40000000;

錯誤:

無法連線

Firefox無法建立到 localhost 伺服器的連線。

修正:

需要將s.cgi複製到apache中

cp /usr/local/aspseek/bin/s.cgi /usr/local/apache2/cgi-bin

錯誤:

An error occured!

Can not connect to search daemon //原因:searchd沒有起來,或者啟動了多次searchd

修正:

(1)轉到目錄:/usr/local/aspseek/var

執行(刪除):rm -rf *

drop database aspseek12;

(2)ps –aux|grep httpd

ps –aux|grep searchd

檢視程序情況

Kill 程序號殺掉多餘的程序,或全部程序,再重新啟動。

(3)執行:root>; /usr/local/aspseek/sbin/aspseek-mysql-postinstall

轉到目錄:/usr/local/aspseek/sbin

執行cp /usr/local/aspseek/lib/libmysqldb-1.3.0pre1.so /usr/lib/mysql

將/etc/ld.so.conf 複製到到/usr/lib/mysql

執行:./index -N10

執行:aspseek>; /usr/local/aspseek/sbin/searchd –D

五、以上步驟中出現的警告及其修正

警告:

../include/templates.h:201:2: warning: 'typedef' was ignored in this declaration

templates.cpp:221:78: warning: deprecated conversion from string constant to 'char*'

charsets.cpp:48:1: warning: deprecated conversion from string constant to 'char*'

charsets.cpp:58:1: warning: deprecated conversion from string constant to 'char*' 

qldbi.cpp:99:9: warning: deprecated conversion from string constant to ‘char*’

sqldbi.cpp:401:36: warning: deprecated conversion from string constant to ‘char*’

config.cpp:224:38: warning: deprecated conversion from string constant to ‘char*’

../include/stack.h:118:36: warning: deprecated conversion from string constant to ‘char*’

./include/search.h:859:34: warning: deprecated conversion from string constant to ‘char*’

ucharset.cpp:167:28: warning: deprecated conversion from string constant to 'char*'

stopwords.cpp:57:29: warning: deprecated conversion from string constant to ‘char*’

geo.cpp:222:74: warning: deprecated conversion from string constant to ‘char*’

templates.cpp:940:63: warning: deprecated conversion from string constant to 'char*'

index.cpp:1243:27: warning: deprecated conversion from string constant to ‘char*’

../include/misc.h:59:0: warning: "MAX" redefined

parse.cpp:775:22: warning: deprecated conversion from string constant to ‘char*’

daemon.cpp:243:36: warning: deprecated conversion from string constant to ‘char*’

qparser.cpp:53:1: warning: deprecated conversion from string constant to ‘char*’

parser.cpp:109:44: warning: deprecated conversion from string constant to ‘char*’

scanner.cpp:31:7: warning: non-local variable ‘<anonymous struct> funcs []’ uses anonymous type

等警告。

修正:

(1)../include/templates.h檔案中的163行:

typedef class CTemplate { à class Ctemplate

(2)src/templates.cpp檔案中的:

221 Errormes[ER_STOPWORDS]= Trim(const_cast<char *>(str + strlen(ER_STOPWORDS) + 1),const_cast<char *>( "=\t\r\n"))

221---287改法相同

940 if (LoadTemplate(const_cast<char *>(templ), "", const_cast<char *>("include")))

(3)src/sqldbi.cpp檔案中的:

99 return ""; -> 

401 case 0: return(const_cast<char *>("Not indexed yet")); 

(4)src/config.cpp檔案中的: 

222 int size = curl.HTTPGetUrl(wcache,&srv, buf, sizeof(buf) - 1, ALLOW,const_cast<char *>( ""));

(5)src/index.cpp檔案中的:

1243 static char *config_name=const_cast<char *>( "aspseek.conf");

1278 char* logname = const_cast<char *>(DEFAULT_LOGNAME);

(6)include/misc.h檔案中的:

58 #undef MAX

59 #define MAX(a,b) ((a) > (b) ? (a) : (b))

(7)src/ parse.cpp檔案中的:
775 Trim(charset, const_cast<char *>(" "));

(8)src/ qparser.cpp檔案中的:

221 error(const_cast<char *>(ER_EMPTYQUERY));

(9)src/ scanner.cpp檔案中的:

30 struct {int type; ScannerVoidFunc func;}

31 funcs[] =

32 {

33 {xBinary1, &CScanner::xBinary},

(10)src/ charsets.cpp檔案中的:

50 static ALIAS Aliases[MAX_ALIAS] ={

51 {CHARSET_USASCII,const_cast<char *>( "us-ascii")},

52 {CHARSET_USASCII,const_cast<char *>( "ascii")},

53 {CHARSET_USASCII,const_cast<char *>( "7bit")},

54 {CHARSET_USASCII,const_cast<char *>( "7-bit")},

55 {CHARSET_USASCII,const_cast<char *>( "iso-ir-6")},

56 {CHARSET_USASCII,const_cast<char *>( "ansi_x3.4")},

57 {-1, NULL}

58 };

(11)/usr/local/aspseek/etc/aspseek.conf檔案中的:

72 UtfStorage yes

六、使用Apache Module時出現的警告、錯誤及其修正

警告:

configure: WARNING: unrecognized options: --enable-modules

原因:

“–-enable-module=so”只適用於apache 1.3.x版本不適合於apache 2.0.x

錯誤:

linux-6rzx:/home/cyh/aspseek # ./configure --enable-apache-module

checking for Apache module support... configure: error:

** Can't find apxs in /usr/lib/mpi/gcc/openmpi/bin /home/cyh/bin /usr/local/bin /usr/bin /sbin /usr/sbin /bin

/usr/bin/X11 /usr/X11R6/bin /usr/games /opt/kde3/bin /usr/lib/mit/bin /usr/lib/mit/sbin /usr/sbin

/usr/local/apache/bin /home/httpd/bin/

修正:

./configure --enable-apache-module=/usr/local/apache2/

錯誤:

if test "xmod_aspseek.so" != "x"; then \

/bin/sh ../libtool --mode=link --tag=CC /usr/local/apache2/bin/apxs -I../include -c \

-o mod_aspseek.so -DHAVE_CONFIG_H mod_aspseek.c \

libaspseek.la -ldl -lz -lpthread; \

libtool: unrecognized option `--tag=CC'

修正:

756 @[email protected] $(LIBTOOL) --mode=link gcc $(APXS) $(INCLUDES) -c \

錯誤:

mod_aspseek.c:29:19: fatal error: httpd.h: No such file or directory

compilation terminated.

修正:

mod_aspseek.c檔案進行以下修改:

29 #include "/usr/local/apache2/include/httpd.h"

30 #include "/usr/local/apache2/include/http_log.h"

31 #include "/usr/local/apache2/include/http_config.h"

32 #include "/usr/local/apache2/include/http_protocol.h"

33 #include "/usr/local/apache2/include/http_main.h"

34 #include "/usr/local/apache2/include/ap_config.h"

錯誤:

In file included from /usr/local/apache2/include/httpd.h:43:0,

from mod_aspseek.c:29:

/usr/local/apache2/include/ap_config.h:25:17: fatal error: apr.h: No such file or directory

compilation terminated.

修正:

/usr/local/apache2/include/ap_config.h檔案進行以下修改:

25 #include "/usr/include/apr-1/apr.h"

26 #include "/usr/include/apr-1/apr_hooks.h"

27 #include "/usr/include/apr-1/apr_optional_hooks.h"

錯誤:

/usr/local/apache2/include/os.h:31:17: fatal error: apr.h: No such file or directory

compilation terminated.

修正:

/usr/local/apache2/include/os.h檔案進行以下修改:

31 #include "/usr/include/apr-1/apr.h"

32 #include "/usr/include/apr-1/ap_config.h"

七、使用Php Module時出現的警告、錯誤及其修正

錯誤:

inux-6rzx:/usr/local/apache2/bin # ./httpd

httpd: Syntax error on line 53 of /usr/local/apache2/conf/httpd.conf: Cannot load

/usr/local/apache2/modules/libphp5.so into server: /usr/local/apache2/modules/libphp5.so: undefined symbol:

php_escape_html_entities

修正:

每次重新配置了php後,一定要make clean後再重新make && make install

錯誤:

inux-6rzx:/home/cyh/aspseek-php-1.0.0-alpha3 # make && make install時報錯:

/home/cyh/aspseek-php-1.0.0-alpha3/aspseek.c:216:1: error: ‘OnUpdateInt’ undeclared here (not in a function)

/home/cyh/aspseek-php-1.0.0-alpha3/aspseek.c:217:1: error: ‘OnUpdateInt’ undeclared here (not in a function)

/home/cyh/aspseek-php-1.0.0-alpha3/aspseek.c:218:1: error: ‘OnUpdateInt’ undeclared here (not in a function)

修正:

216行:STD_PHP_INI_BOOLEAN("aspseek.allow_persistent", "1", PHP_INI_SYSTEM, OnUpdateBool,

allow_persistent, zend_aspseek_globals, aspseek_globals)

217行:STD_PHP_INI_ENTRY_EX("aspseek.max_persistent", "-1", PHP_INI_SYSTEM, OnUpdateBool,

max_persistent, zend_aspseek_globals, aspseek_globals, display_link_numbers)

218行:STD_PHP_INI_ENTRY_EX("aspseek.max_links", "-1", PHP_INI_SYSTEM, OnUpdateBool,

max_links, zend_aspseek_globals, aspseek_globals, display_link_numbers)

錯誤:

php –m :發現aspseek.so沒有被掛載到php

修正:

在確保apache可以正常解析(即:test.php中的phpinf()可以正常顯示)的前提下,可以重新安裝php和php-aspseek

模組,並要確保配置檔案正確

錯誤:

載入字符集配置檔案時出錯,段錯誤

修正:

ucharset.cpp檔案中的LoadCharsetU2V()函式進行以下修改:

207行:if (sscanf(chp, "%x %x", &code, &ucode) == 2)

錯誤:

執行index抓取時,顯示Error locking mutex:Invalid Argument

修正:

content.h檔案中的virtual ~CUrlContent()函式進行以下修改:

222行{

Save();

this->clear();

}

錯誤:

[email protected]:/usr/local/apache2/bin> /usr/local/aspseek/sbin/searchd -D

WARNING: Can't open logfile /usr/local/aspseek/var/dlog.log: Permission denied

Starting search daemon from ASPseek v.1.4.0

修正:

linux-6rzx:/usr/local/aspseek # chmod o+w var 

錯誤:

位址列輸入:http://localhost/search.php

Warning: Could not connect to search daemon in /usr/local/apache2/htdocs/search.php on line 29

Warning: ASPseek Connection Failed: Could not connect to search daemon in /usr/local/apache2/htdocs/search.php

on line 29

An error occured!

Could not connect to search daemon

修正:

可能是searchd沒有啟動或啟動了多次,注意aspseek的步驟都要做一遍

錯誤:

查詢結果頁面中漢字不能正常顯示

修正:

(1)/usr/local/apache2/htdocs/top.inc第3行:header("Content-type: text/html; charset=gb2312");

(2)aspseek.cpp檔案中的 1179行新增:

if(cgiQuery.m_charset.size()==0)

cgiQuery.m_charset="gb2312";

(3)ucharset.conf檔案中的35行新增:

CharsetAlias gb2312 gbk

錯誤:

搜尋結果無法顯示,searchd進入死迴圈

修正:

daemon.cpp檔案中的void AddStat(CBufferedSocket& socket, CSQLDatabase* database)函式

628行起進行以下修改:

if (socket.RecvTime_t(start.tv_sec) <= 0) return;

datasource.cpp檔案中的void CTcpDataSource::AddStat函式344行起進行以下修改:

m_socket.SendTime_t(start.tv_sec);

m_socket.SendTime_t(finish.tv_sec);

錯誤:

快照無法顯示

修正:

sqldb.cpp檔案中的BYTE* Uncompress()函式進行以下修改:

1249行:

if (cont && (len >= SIZEOF_VOID_P))

{

BYTE* uc;

uLen = *(ULONG*)cont;

if (uLen == 0xFFFFFFFF)

{

uLen = len - SIZEOF_VOID_P;

uc = new BYTE[uLen + 1];

memcpy(uc, cont + SIZEOF_VOID_P, uLen);

}

else

{

uc = new BYTE[uLen + 1];

uncompress(uc, &uLen, cont + SIZEOF_VOID_P, len);

}

錯誤:

結果分組出錯,段錯誤

修正:

search.cpp檔案中的CResult::GetUrls(CUrlWeight2* start, CUrlWeight2*& dst, int gr, int sortBy)函式進行以下修改:

2369行:WORD* url2 = si->m_maxwoffset2 == ~0 ? NULL : (WORD*)((BYTE*)m_urls + si->m_maxwoffset2);

2383行:start->m_urlr2 = si->m_maxwoffset2 == ~0 ? NULL : (WORD*)((BYTE*)m_urls + si->m_maxwoffset2);