PHP Apache Dynamic Shared Object (DSO)  ϱ
======================================================

: Ϻ ÷ DSO  Apache/PHP Ҿϴٴ 
ֽϴ.  ̷  Ÿٸ PHP INSTALL Ͽ  
 static ·   ٶ.    Apache 
1.3.4  ϰ  ʴٸ ϰ static · ϱ
ٶ. ׷ ʴٸ Apache ׷̵ϵ Ѵ.

  :

   1: APXS 
  METHOD 2: --with-shared-apache 
   ذ


 1: APXS 
-----------------

  PHP ̹ /ǰ ִ Apache  ߰ϴ
  ̴.   mod_so ϵ 
־ Ѵ.("httpd -l" Ȯ  ִ.) ,'apxs' Perl 
ũƮ ġǾ ְ, ϴ  setup   ֵ Ǿ 
־ Ѵ. Ʒ Step 1  ϸ ϴ  setup   ִ.

Step 1: 켱 Apache . ̶ ݵ mod_so enableѾ Ѵ. 
          ϸ ȴ. :

   cd apache-1.3.x
   ./configure --prefix=/some/path --enable-shared=max
   make
   make install

Apache  ɼǿ  ڼ  Apache  ִ README.configure 
 .  /some/path/bin/apxs  丮 ִ° Ȯ
д. step 2 Ѿ 'apxs' α׷  ġ ִ° ˾ƾ Ѵ.

Step 2: PHP .

   cd php-3.0.x
   ./configure  --with-apxs=/some/path/bin/apxs \
                --with-config-file-path=/some/path
  make
  make install

  ϴ  ɼ   ִ. ڼ ɼ Ʈ ϸ
./configure --help  .

Step 3: /some/path/conf/httpd.conf  Ͽ    
        ϵ Ѵ. :

        AddType application/x-httpd-php3 .php3

 ϴ ٸ ɼǵ鵵 httpd.conf ϵ Ѵ.

 php3.ini-dist ϵ /some/path/php3.ini  ΰ ϴ 
ϵ Ѵ.

Step 4:  Start/Restart :

    /some/path/bin/apachectl start
or
    /some/path/bin/apachectl restart
or
    /some/path/bin/apachectl graceful


 2: --with-shared-apache 
---------------------------------

   Ŀ  ׷  ʴ. ׷  
 apxs     ϰ   ִ. apxs 
Apache setup 'make install'Ͽ   ϸ ʿѵ ؼ 
 PHP ϱ   Apache source tree ü ʿϴ.

Step 1: Apache ./configure α׷ ּ ѹ Ѵ. ü
          ʿ , Apache ./configure α׷  
        Ϻ   ʿϱ ̴.   Apache ./configure
        Ѱִ ɼǵ ƹ ǹ̰ .

Step 2:  PHP ϰ, Apache ҽ Ʈ  ִ°  ش.
           ϸ ȴ.

./configure --with-shared-apache=/some/path/to/src/of/apache-1.3.X \
            --with-config-file-path=/some/path
make
make install

 ٸ PHP ɼ  ַ,  configure ο ߰ ָ ȴ.
./configure --help  ڼ ɼ Ȯ.

Step 3: Apache 

Apache src tree 丮 ̵Ͽ    Ѵ.

./configure --prefix=/some/path \
            --activate-module=src/modules/php3/libphp3.a \
            --enable-shared=php3
make 
make install

̹   Apache ġǾ ִٸ,  쿡 'make install' ϸ 
ȴ.  --prefix 丮 ٸ ӽ 丮 Ͽ  ϵ
   õѴ. Ư PHP  loadϴ httpd.conf   캸.
׿ܿ ؾ   php3  AddType  ڸƮ(ù° ĭ #)  
̴.     . :

  AddType application/x-httpd-php3 .php3


 ذ
---------

If you are compiling PHP with support for a whole whack of modules and
want to load the whole mess dynamically, you may find yourself getting
the following error:

ld: fatal: too many symbols require `small' PIC references:
        have 2077, maximum 2048 -- recompile some modules -K PIC.

This should not happen on any Intel platforms, but I ran across it on
a Sun Sparc box running Solaris.  The message which comes from the
linker is assuming I am using the native Sun C compiler I guess and
suggests I use "-K PIC".  This may be correct if you are using that
compiler.  For gcc the way to fix it is to edit the PHP Makefile and
near the top find the line that says: CFLAGS_SHLIB = -fpic
and change the "-fpic" to "-fPIC".  I would imagine that this would
slow things down a bit though and you might want to consider doing a
static build instead.
