views:

222

answers:

4

Leopard 10.5.6 Macbook Zend 1.6, Apache 2, PHP 5.2.5

I cannot seem to do indexing, using Zend_Search_Lucene api. Building or opening indices on generates the following exception message:

string(30) "Wrong segments.gen file format"

However, the indices/segments files were scp from a working version of my site and I've chmoded them all to 777, so I don't believe it is a permissions thing.

Not sure which direction to try - looking for some ideas.

A: 

One option is that you are using different versions of Lucene on the different machines. The Zend documentation says Zend 1.6 supports Lucene 2.3 format. Maybe the other machine uses an older/newer Lucene version.

Yuval F
How do I check the Lucene format on a system?
Try using Luke: http://www.getopt.org/luke/ (I would first check that the two Zend frameworks are identical).Luke 0.8 is based on Lucene 2.3 and compatible with ZF 1.6. Luke 0.71 is based on Lucene 2.1 and compatible with ZF 1.5.Luke 0.6 is based on Lucene 1.4 and compatible with ZF 1.0.
Yuval F
So, Luke 0.9 was able to open and read the indices that function on the other machine, and determined that the Lucene version is 2.2.However, no version of Luke can open any of the indices I tried to create on Leopard. These are working on XP checkouts of the site, but not on any Leopard system I checkout onto.Is this a Mac thing?
It Looks like a mac thing. Is the PHP version working fine on Mac? Are other parts of the Zend framework working? Maybe the different file system is to blame?
Yuval F
Everything else Zend is working fine. However, I'm told that Zend_Search_Lucene has snafus with NFS. So this makes me wonder if it also has trouble with HFS or other file systems. sux.
A: 

You might also run into case sensitivity issues with Leopard versus Linux/Unix, if you're deploying to those.

OR it could be an absolute versus relative path issue. If I recall correctly, Zend_Search_Lucene likes absolute paths. If your include paths differ, that could be causing the issue.

lo_fye
Another Mac user on my team does NOT have this problem, so it apparently is not a Mac thing. Weird.
BTW his file system is Mac OS Extended (Journaled), i.e., like mine, not case sensitive. Isn't anybody else using Zend Lucene on Leopard?
Case sensitivity in Leopard is optional, and not recommended. It comes with case sensitivity turned off. BUT linux/unix ARE case sensitive. So I'm saying he may be developing on a non-case-sensitive system, and deploying to a case-sensitive system, and then... KABOOM!
lo_fye
Checked his filesystem - same exact as mine. It may be a PHP version thing, as our versions are off. That's the only thing I can think of at this point, and of course there's not time to rebuild PHP at this particular juncture.
+1  A: 

My PHP binary was 32-bit. PHP_INT_SIZE was 4. This confused Zend which checks for the systems int size, which on Leopard is 8 bits. Switching to XAMMP, the PHP 64bit binary, solved Lucene filesystem issues. It was not related to case-sensitivity or paths. It had to do with using the Marc Liyanage pkg php/mysql/apache. Updating to the latest Liyanage pkg did not solve this problem. Using XAMMP did. Yay.

A: 

I have this problem too, on my Macbook Pro Core Duo.

Is it possible to fix without using XAMMP? By patching Zend_Search_Lucene or by doing something else?

sandstrom
If you build 64bit PHP on your Macbook it will fix this.