On Wed, 10 Sep 2008 11:06:32 -0400, Cristian Rodríguez
<[EMAIL PROTECTED]> wrote:

Dear Cristian,

>> I'm trying to compile a statically linked, without shared libs, 
> 
> Why you want such thing ?

We want to provide a method to "customize" PHP version to our clients; for
example, all our servers run with PHP 5.1.6, but if one client needs PHP
v5.2.6 to run X CMS.. so we provide a statically linked version of the CGI
for 5.2.6.

In the future, if we upgrade from CentOS 4 to CentOS 5 (for example).. all
clients running with the default PHP version in the server will not have
problem. But clients with "personalized" PHP version running as CGI, will
have problems: there will be no available the shared libs wich is
dynamically linked to..

So, we want to provide this version of the CGI.., we know that the version
of the CGI will be bigger, and that's not a good idea, but we need to do it
;-(


>> How can I compile statically the CGI version of PHP? Thanks!! 
> 
> even if you manage to link all libraries statically, you will end with a
> huge, memory hungry and hard to debug php binary that anyways require
> shared libc at runtime ;-P

Yes, it maybe a problem.. 

Now we're using statifier [1] to convert dynamically linked executables and
all it's libraries in one file:

# file php-cgi
php-cgi: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for
GNU/Linux 2.2.5, dynamically linked (uses shared libs), not stripped

# ldd php-cgi | head -10
        libcrypt.so.1 => /lib/libcrypt.so.1 (0x00335000)
        libc-client.so.0 => /usr/lib/libc-client.so.0 (0x00397000)
        libexslt.so.0 => /usr/lib/libexslt.so.0 (0x00367000)
        libz.so.1 => /usr/lib/libz.so.1 (0x00323000)
        libm.so.6 => /lib/tls/libm.so.6 (0x002fe000)
        libaspell.so.15 => /usr/lib/libaspell.so.15 (0x00767000)
        libpspell.so.15 => /usr/lib/libpspell.so.15 (0x00111000)
        librt.so.1 => /lib/tls/librt.so.1 (0x006b2000)
        libmysqlclient.so.14 => /usr/lib/mysql/libmysqlclient.so.14
(0x001c8000)
        libmcrypt.so.4 => /usr/lib/libmcrypt.so.4 (0x00f67000)

# statifier php-cgi php-cgi.statifier

# file php-cgi.statifier
php-cgi.statifier: ELF 32-bit LSB executable, Intel 80386, version 1
(SYSV), dynamically linked, not stripped

# ldd php-cgi.statifier
        not a dynamic executable

statifier'd version of the CGI works fine.. but we're looking a better
method to directly built the CGI.

# ls -lh php-cgi php-cgi.statifier
-rwxr-xr-x  1 root root 7.0M Sep 10 15:10 php-cgi
-rwxr-xr-x  1 root root  19M Sep 10 17:14 php-cgi.statifier

Regards,

[1] http://statifier.sourceforge.net/

--
Santi Saez
http://woop.es


-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to