[NCLUG] Static compiles

Joshua SS Miller joshua at fitsnips.net
Fri May 31 14:11:11 MDT 2002


Thank you.  In this instance I am not really concerned about size of the
binary, my boss will have to deal with on or the other, and at this
point run anywhere is the goal.

Joshua

On Fri, 2002-05-31 at 13:11, Michael Dwyer wrote:
> Joshua SS Miller wrote:
> > I am looking to compile static versions of php and apache, but
> > not being a programmer I need a little help.  What I need to end
> > up with is a Apache and php module that do not depend on any thing
> > else on the box.  I want to be able to move it to another Linux box
> > and it just runs, no complaining "*lib not found".  All boxes will
> > be x86 running the Linux kernel, so I know that much, other then that I
> > can not say how much they will diff.
> 
> I've always compiled my PHP static /into/ Apache.  This means that you
> don't need a php library stuck on the outside.  The directions for this
> are in the PHP documentation.  In general, it is something like:
> 
>    ./configure --with-apache=../apache-1.3
> 
> ...though, you actually have to run it twice... See the readme's to see
> what I mean.
> 
> As for getting the rest of Apache to compile static... uh... yikes.  It
> is going to be HUGE, I hope you are aware...  I believe that you can add
> the -STATIC option to the compiler/linker arguments in the makefiles.
> 
> Possibly a better alternative is to carefully craft your Apache/PHP
> binary so that it doesn't include any strange libraries that you don't
> need.  PHP has a LOT of compilation options.  But if you decide that,
> for instance, you don't need the GD functionality, you can leave off a
> LOT of extra libraries -- like libtiff and libpng and libjpeg.  If you
> aren't going to be running a webmail system, you can leave off the IMAP
> stuff. 
> 
> This might be a better way to do it.  I consider myself a
> built-in-to-Apache-static PHP compiling ninja, so I might be able to
> help you chose which options you want...





More information about the NCLUG mailing list