when i use the search functionality, this is the result.

warning: Compilation failed: characters with values > 255 are not yet supported in

classes at offset 143 in search.module on line 236.

Comments

gkrishna’s picture

is it because i am using htmlarea module ?

--**--
krishna

Steven’s picture

This sounds like an outdated PHP installation. What version of PHP are you running on what platform?

gkrishna’s picture

PHP 4.3.1

--**--
krishna

torgeirb’s picture

I'm also getting this error when building the search index. This is on php 4.3.2 so not exactly ancient. (head from 30/12-2004)

Steven’s picture

The CVS search requires PHP 4.1+ on Unices and PHP 4.2.3+ on Windows at least for UTF-8 compatibility (that's what the php docs say), but it is possible that a higher version is needed to actually use high Unicode characters with it.

I developed the search on PHP 4.3.3 on Windows, so at least that version works.

AndriyM’s picture

What is the update on this? Will no version earlier than 4.3.3 run this search?

I personally have PHP 4.3.2 running on RedHat and I get two errors upon running a search query. The first refers to offset 52 on line 257 of search.module and the second to offset 143 on line 265.

Morbus Iff’s picture

The current response is "you need 4.3.3" (our documentation is being updated to reflect this) and "oof! that sucks! is someone willing to backport the new search.module to Drupal 4.5, perhaps?" and no one currently volunteering. Theoretically, if you're using the RedHat supplied PHP, you should be able to just yum, apt, or RPM an update, no?

http://disobey.com/
http://gamegrene.com/

AndriyM’s picture

Unfortunately, I don't have direct access to the web server. As it also runs other, more "important" sites than my Drupal project, it's doubtful that they'd be willing to update the PHP and take the risk of bringing those down. I will try asking, however. Thanks for the info.

insomoz’s picture

Im running php version 4.3.10 and get the same error
is there a fix

rayray’s picture

Am I to understand that all of Drupal now requires 4.3.3? There's a big disclaimer about supporting 5.0 on the install notes but none regarding 4.3.3, which really seems kinda annoying. To realize that after upgrading and stuff.

And just for the search? This makes no sense. Seems like something that should "just work" rather than being "mysteriously the one thing that breaks completely."

Sorry, just sharing my take on this!

jagdfalke’s picture

The complete error message I get is this one:

Compilation failed: characters with values > 255 are not yet supported in classes at offset 52 in /[...]/drupal/modules/search.module on line 258.

The function producing the message is preg_replace, so I guess it depends on what version of the libpcre is used.
On my localhost, where I do not get this message, I have PHP 4.3.11, using "PCRE Library Version" "4.5 01-December-2003" (quota from phpinfo()).
On a server, where I do get this message, PHP 4.3.2 using "PCRE Library Version" "3.9 02-Jan-2002", which is obviously a lot older. So I guess this is the clue here.

Note that there are the possibilities of using a version of libpcre which comes with PHP, or using a version provided by the system. The former is done on my machine, since I have libpcre 5 installed, and the latter is done on the server, where PHP has been configured with '--with-pcre-regex=/usr' and rpm reports version 3.9.

I don't know which version of PHP has what kind of version of libpcre, so I'd suggest to either recompile PHP 4.3.11 using its own libpcre, or get a recent version of libpcre, and compile PHP with that.

Also note http://www.pcre.org/pcre.txt (which linked from http://de.php.net/manual/en/ref.pcre.php)

Regards,
Milan

bitman’s picture

If you can't upgrade your server, you can strip out all the multi-byte characters from the search code. This patch to search.module seems to do the trick:

33c33
< define('PREG_CLASS_SEARCH_EXCLUDE', '\x{0}-\x{23}\x{25}-\x{2a}\x{2c}-\x{2f}\x{3a}\x{3b}\x{3f}\x{40}\x{5b}-\x{5d}\x{5f}\x{7b}\x{7d}\x{7f}-\x{a1}\x{ab}\x{ad}\x{b7}\x{bb}\x{bf}\x{37e}\x{387}\x{488}\x{489}\x{55a}-\x{55f}\x{589}\x{58a}\x{5be}\x{5c0}\x{5c3}\x{5f3}\x{5f4}\x{600}-\x{603}\x{60c}\x{60d}\x{61b}\x{61f}\x{66a}-\x{66d}\x{6d4}\x{6dd}\x{6de}\x{700}-\x{70d}\x{70f}\x{964}\x{965}\x{970}\x{df4}\x{e4f}\x{e5a}\x{e5b}\x{f04}-\x{f12}\x{f3a}-\x{f3d}\x{f85}\x{104a}-\x{104f}\x{10fb}\x{1361}-\x{1368}\x{166d}\x{166e}\x{1680}\x{169b}\x{169c}\x{16eb}-\x{16ed}\x{1735}\x{1736}\x{17b4}\x{17b5}\x{17d4}-\x{17d6}\x{17d8}-\x{17da}\x{1800}-\x{180a}\x{180e}\x{1944}\x{1945}\x{2000}-\x{2043}\x{2045}-\x{2051}\x{2053}\x{2054}\x{2057}\x{205f}-\x{2063}\x{206a}-\x{206f}\x{207d}\x{207e}\x{208d}\x{208e}\x{20dd}-\x{20e0}\x{20e2}-\x{20e4}\x{2329}\x{232a}\x{23b4}-\x{23b6}\x{2768}-\x{2775}\x{27e6}-\x{27eb}\x{2983}-\x{2998}\x{29d8}-\x{29db}\x{29fc}\x{29fd}\x{3000}-\x{3003}\x{3008}-\x{3011}\x{3014}-\x{301f}\x{3030}\x{303d}\x{30a0}\x{30fb}\x{d800}\x{db7f}\x{db80}\x{dbff}\x{dc00}\x{dfff}\x{e000}\x{f8ff}\x{fd3e}\x{fd3f}\x{fe30}-\x{fe52}\x{fe54}-\x{fe61}\x{fe63}\x{fe68}\x{fe6a}\x{fe6b}\x{feff}\x{ff01}-\x{ff03}\x{ff05}-\x{ff0a}\x{ff0c}-\x{ff0f}\x{ff1a}\x{ff1b}\x{ff1f}\x{ff20}\x{ff3b}-\x{ff3d}\x{ff3f}\x{ff5b}\x{ff5d}\x{ff5f}-\x{ff65}\x{fff9}-\x{fffb}\x{10100}\x{10101}\x{1039f}\x{1d173}-\x{1d17a}\x{e0001}\x{e0020}-\x{e007f}\x{f0000}\x{ffffd}\x{100000}');
---
> define('PREG_CLASS_SEARCH_EXCLUDE', '\x{0}-\x{23}\x{25}-\x{2a}\x{2c}-\x{2f}\x{3a}\x{3b}\x{3f}\x{40}\x{5b}-\x{5d}\x{5f}\x{7b}\x{7d}\x{7f}-\x{a1}\x{ab}\x{ad}\x{b7}\x{bb}\x{bf}');
38c38
< define('PREG_CLASS_NUMBERS', '\x{30}-\x{39}\x{b2}\x{b3}\x{b9}\x{bc}-\x{be}\x{660}-\x{669}\x{6f0}-\x{6f9}\x{966}-\x{96f}\x{9e6}-\x{9ef}\x{9f4}-\x{9f9}\x{a66}-\x{a6f}\x{ae6}-\x{aef}\x{b66}-\x{b6f}\x{be7}-\x{bf2}\x{c66}-\x{c6f}\x{ce6}-\x{cef}\x{d66}-\x{d6f}\x{e50}-\x{e59}\x{ed0}-\x{ed9}\x{f20}-\x{f33}\x{1040}-\x{1049}\x{1369}-\x{137c}\x{16ee}-\x{16f0}\x{17e0}-\x{17e9}\x{17f0}-\x{17f9}\x{1810}-\x{1819}\x{1946}-\x{194f}\x{2070}\x{2074}-\x{2079}\x{2080}-\x{2089}\x{2153}-\x{2183}\x{2460}-\x{249b}\x{24ea}-\x{24ff}\x{2776}-\x{2793}\x{3007}\x{3021}-\x{3029}\x{3038}-\x{303a}\x{3192}-\x{3195}\x{3220}-\x{3229}\x{3251}-\x{325f}\x{3280}-\x{3289}\x{32b1}-\x{32bf}\x{ff10}-\x{ff19}\x{10107}-\x{10133}\x{10320}-\x{10323}\x{1034a}\x{104a0}-\x{104a9}\x{1d7ce}-\x{1d7ff}');
---
> define('PREG_CLASS_NUMBERS', '\x{30}-\x{39}\x{b2}\x{b3}\x{b9}\x{bc}-\x{be}');
43c43
< define('PREG_CLASS_PUNCTUATION', '\x{21}-\x{23}\x{25}-\x{2a}\x{2c}-\x{2f}\x{3a}\x{3b}\x{3f}\x{40}\x{5b}-\x{5d}\x{5f}\x{7b}\x{7d}\x{a1}\x{ab}\x{b7}\x{bb}\x{bf}\x{37e}\x{387}\x{55a}-\x{55f}\x{589}\x{58a}\x{5be}\x{5c0}\x{5c3}\x{5f3}\x{5f4}\x{60c}\x{60d}\x{61b}\x{61f}\x{66a}-\x{66d}\x{6d4}\x{700}-\x{70d}\x{964}\x{965}\x{970}\x{df4}\x{e4f}\x{e5a}\x{e5b}\x{f04}-\x{f12}\x{f3a}-\x{f3d}\x{f85}\x{104a}-\x{104f}\x{10fb}\x{1361}-\x{1368}\x{166d}\x{166e}\x{169b}\x{169c}\x{16eb}-\x{16ed}\x{1735}\x{1736}\x{17d4}-\x{17d6}\x{17d8}-\x{17da}\x{1800}-\x{180a}\x{1944}\x{1945}\x{2010}-\x{2027}\x{2030}-\x{2043}\x{2045}-\x{2051}\x{2053}\x{2054}\x{2057}\x{207d}\x{207e}\x{208d}\x{208e}\x{2329}\x{232a}\x{23b4}-\x{23b6}\x{2768}-\x{2775}\x{27e6}-\x{27eb}\x{2983}-\x{2998}\x{29d8}-\x{29db}\x{29fc}\x{29fd}\x{3001}-\x{3003}\x{3008}-\x{3011}\x{3014}-\x{301f}\x{3030}\x{303d}\x{30a0}\x{30fb}\x{fd3e}\x{fd3f}\x{fe30}-\x{fe52}\x{fe54}-\x{fe61}\x{fe63}\x{fe68}\x{fe6a}\x{fe6b}\x{ff01}-\x{ff03}\x{ff05}-\x{ff0a}\x{ff0c}-\x{ff0f}\x{ff1a}\x{ff1b}\x{ff1f}\x{ff20}\x{ff3b}-\x{ff3d}\x{ff3f}\x{ff5b}\x{ff5d}\x{ff5f}-\x{ff65}\x{10100}\x{10101}\x{1039f}');
---
> define('PREG_CLASS_PUNCTUATION', '\x{21}-\x{23}\x{25}-\x{2a}\x{2c}-\x{2f}\x{3a}\x{3b}\x{3f}\x{40}\x{5b}-\x{5d}\x{5f}\x{7b}\x{7d}\x{a1}\x{ab}\x{b7}\x{bb}\x{bf}');

This is by no means the best solution, but it should work for sites that don't use unicode.

jmeade’s picture

I had the same error of characters > 255 and I have applied the fix above to the search module. The cron job runs successfully now but there are no records in the search_index table.

I am running PHP 4.4.1, Apache 1.3.26 and MySQL 3.23 on Windows.

mrichar1’s picture

That happened to me too. Seems that somehow drupal got confused and thought there was nothing left to index. In order to correct that issue you can edit settings.php to temporarily rest the node_last_cron variable so that drupal starts the indexing process from scratch.

In settings.php edit the $conf variable at the bottom of the page like this:

$conf = array(
'node_cron_last' => '0'
);

Then manually run cron once by visiting www.yousite.com/cron.php

Then undo your change to settings.php and continue running cron until you site is fully indexed. You can view the indexing progress at administer -> settings -> search.

mrichar1’s picture

If you can't upgrade your server, you can strip out all the multi-byte characters from the search code. This patch to search.module seems to do the trick:

Thanks for the solution.

After appyling that fix I also ran into a warning that arose because the offset parameter was added to preg_match in PHP 4.3.3 and I was running 4.3.2.

Around line 753 I replaced

This:

if (preg_match('/\b'. $key .'\b/iu', $text, $match, PREG_OFFSET_CAPTURE, $included[$key])) {

With this:

if (preg_match('/\b'. $key .'\b/iu', substr($text,$included[$key]), $match, PREG_OFFSET_CAPTURE)) {

It isn't a perfect substitute, but it works.

See: http://www.php.net/manual/en/function.preg-match.php