1

私が思うにかなりまっすぐです。これは実行可能ですか?

背景: Suse Enterprise 9 で php-cgi を実行する必要があり、システム以外のバージョンの glibc を使用するための LD_PRELOAD または LD_LIBRARY_PATH を取得できないため、これを行っています。

php-cgi: /lib/tls/libc.so.6: version `GLIBC_2.7' not found

ここから2.7をダウンロードしました

http://rpmfind.net/linux/rpm2html/search.php?query=libc.so.6(GLIBC_2.7 )

より正確に

ftp://rpmfind.net/linux/sourceforge/r/ro/roblinux/64-32_pkg/core/i686/glibc-2.7-2rt.i686.rpm

rpm2cpio を使用して解凍します。

PHP をインストールできず、Tomcat から PHP を実行するために JavaBridge を試したいので、php-cgi が必要です。

4

1 に答える 1

1

How can I compile php-cgi binary using a custom glibc for suse enterprise linux out of cygwin?

Pretty straight to the point I think.

No, a very confused and circuitous question.

First, cygwin has absolutely nothing to do with your question: it's for running UNIX programs on Windows, which is not at all what you are asking about.

Second, your question appears to be: "how do I run pre-build php-cgi binary on a system that has older glibc than the one php-cgi has been built on?", and not about compiling anything.

To that question, the answer is: you can't (easily) -- UNIX systems do not support forward binary compatibility (build on a new system, run on an older one). Only backward compatibility is supported (old dynamically-linked binaries continue to run on newer systems).

Your best approach is to try to build php-cgi on your system (which would eliminate its dependency on GLIBC_2.7. If you can't, you should still be able to run such a binary against unpacked glibc-2.7 build, if that binary doesn't re-exec itself. The way to do that, assuming you unpacked glibc-2.7 into e.g. /tmp/glibc-2.7 is something like:

/tmp/glibc-2.7/lib/ld-linux.so.2 --library-path \
    /tmp/glibc-2.7/lib:/lib:/usr/lib \
  /path/to/php-cgi <args>

(The library path above may need some adjustments to make the loader find all the required libraries.)

Update:

is it practical to compile stuff for my linux box in cygwin

It is possible, but significantly more pain then simply compiling on the linux box itself (and so isn't really practical). You appear to lack any reason to want to do that, other than mis-guided belief that cygwin solves all problems.

于 2012-07-08T20:23:13.180 に答える