Hi folks,
I am running a PHP Script on the CLI (logged in as root). It is actually building a Zend Lucene Search index.
All output is logged to the command line. PHP directves like max_execution_time and memory_limit are set sufficient (0 resp. 1024M). The error reporting is set in the script as follows:
error_reporting(E_ALL | E_STRICT);
ini_set('display_errors', 1);
If I throw an exception manually, it is logged to the CLI.
It works like a charm on Windows (scary?).
On Debian Linux it always hangs at a certain point (actually exactly when the first document is being commited to the Lucene index; from there it's Zend Framework code) and keeps on running endlessly eating up all CPU time. On both - Windows and Debian - Zend Server CE is installed with (almost) identical configuration (PHP 5.3.2, etc.).
I have checked the PHP CLI error log (php -i | grep error_log) and other logs I could think of - without any luck. If I run the script in the browser, the same thing happens: the Apache process keeps on running forever.
The index files are being created, so there is no file permission problem. And since it is working on Windows I believe I can rule out a programming error, e.g. an endless loop.
Any ideas how to debug this? Any help pointing me in the right direction would be appreciated.
@Tim-Fountain: Thanks for the suggestion. I used strace to trace the PHP process and could locate the problematic part:
[...]
time(NULL) = 1279015138
lstat("/var/www/svn/trunk/application/../data/search/development.index.de/_c.cfs", 0x7fff4f54d720) = -1 ENOENT (No such file or directory)
open("/var/www/svn/trunk/data/search/development.index.de/_c.cfs", O_RDWR|O_CREAT|O_TRUNC, 0666) = 22
fstat(22, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
lseek(22, 0, SEEK_CUR) = 0
chmod("/var/www/svn/trunk/application/../data/search/development.index.de/_c.cfs", 0666) = 0
write(22, "\10"..., 1) = 1
write(22, "\0\0\0\0\0\0\0\0"..., 8) = 8
write(22, "\6"..., 1) = 1
write(22, "_c.fdx"..., 6) = 6
write(22, "\0\0\0\0\0\0\0\0"..., 8) = 8
write(22, "\6"..., 1) = 1
write(22, "_c.fdt"..., 6) = 6
write(22, "\0\0\0\0\0\0\0\0"..., 8) = 8
write(22, "\6"..., 1) = 1
write(22, "_c.fnm"..., 6) = 6
write(22, "\0\0\0\0\0\0\0\0"..., 8) = 8
write(22, "\6"..., 1) = 1
write(22, "_c.nrm"..., 6) = 6
write(22, "\0\0\0\0\0\0\0\0"..., 8) = 8
write(22, "\6"..., 1) = 1
write(22, "_c.tis"..., 6) = 6
write(22, "\0\0\0\0\0\0\0\0"..., 8) = 8
write(22, "\6"..., 1) = 1
write(22, "_c.tii"..., 6) = 6
write(22, "\0\0\0\0\0\0\0\0"..., 8) = 8
write(22, "\6"..., 1) = 1
write(22, "_c.frq"..., 6) = 6
write(22, "\0\0\0\0\0\0\0\0"..., 8) = 8
write(22, "\6"..., 1) = 1
write(22, "_c.prx"..., 6) = 6
lseek(22, 1, SEEK_SET) = 1
write(22, "\0\0\0\0\0\0\0y"..., 8) = 8
lseek(22, 121, SEEK_SET) = 121
lseek(13, 0, SEEK_SET) = 0
lseek(13, 0, SEEK_END) = 8
lseek(13, 0, SEEK_SET) = 0
read(13, "\0\0\0\0\0\0\0\0"..., 8192) = 8
write(22, "\0\0\0\0\0\0\0\0"..., 8) = 8
close(13) = 0
unlink("/var/www/svn/trunk/application/../data/search/development.index.de/_c.fdx") = 0
lseek(22, 16, SEEK_SET) = 16
write(22, "\0\0\0\0\0\0\0\201"..., 8) = 8
lseek(22, 129, SEEK_SET) = 129
lseek(14, 0, SEEK_SET) = 0
lseek(14, 0, SEEK_END) = 3465
lseek(14, 0, SEEK_SET) = 0
read(14, "\20\0\0\0011\1\0\7Event-1\2\0\003455\3\0\0\4\1\5Event\6"..., 8192) = 3465
read(14, ""..., 8192) = 0
write(22, "\20\0\0\0011\1\0\7Event-1\2\0\003455\3\0\0\4\1\5Event\6"..., 3465) = 3465
read(14, ""..., 8192) = 0
read(14, ""..., 8192) = 0
read(14, ""..., 8192) = 0
read(14, ""..., 8192) = 0
read(14, ""..., 8192) = 0
read(14, ""..., 8192) = 0
read(14, ""..., 8192) = 0
[... from here it keeps on repeating this same line ...]
The file "_c.cfs" is actually existing and has 0666 permissions.
I am not shure how to read this. The last line repeats endlessly. Any ideas?