dams            Fri Jul 20 14:11:26 2001 EDT

  Added files:                 
    /phpdoc/en/faq      installation.xml 
  Log:
  Initial Adding to faq
  

Index: phpdoc/en/faq/installation.xml
+++ phpdoc/en/faq/installation.xml
 <chapter id="faq.installation">
  <title>PHP installation</title>
  <titleabbrev>How to install PHP on your machine</titleabbrev>

   <para>
    This section holds common questions about the way to install
    PHP. PHP is available for almost any OS (except may be for 
    MacOS before OSX), and almost any web server.
   </para>
   <para>
    To install PHP, follow the instructions in the 
    <ulink url="&faqurl.file.installation;">INSTALLATION</ulink>
    file located in the distribution. Windows 95 and NT users should also read the 
    <ulink url="&faqurl.file.readmewin;">README.WIN32</ulink>
    file.  There are also some helpful hints for Windows users
    <ulink url="&faqurl.php.manual.config.nt;">here</ulink>.
   </para>
   <para>
    If you are trying to install PHP for use with Netscape's web server on
    Unix see: <ulink url="faqurl.install">&faqurl.install;</ulink>
   </para>

  <qandaset>
   <qandaentry id="faq.installation.php3ini">
    <question>
     <para>
      Where should my php3.ini file be located?
     </para>
    </question>
    <answer>
     <para>
      By default on UNIX it should be in <filename>/usr/local/lib</filename>. 
      Most people will want to change this at compile-time with the 
      <link 
linkend="install.configure.with-config-file-path">--with-config-file-path</link>
       flag.  You would, for example, set it to something like:
     <programlisting>
    --with-config-file-path=/etc
     </programlisting>
     And then you would copy <filename>php3.ini-dist</filename> from 
     the distribution to <filename>/etc/php3.ini</filename> and
     edit it to make any local changes you want.
     </para>
    </answer>
   </qandaentry>

   <qandaentry id="faq.installation.processing">
    <question>
     <para>
      I installed PHP using RPMS, but Apache isn't processing the 
      PHP pages! What's going on here?
     </para>
    </question>
    <answer>
     <para>
      Assuming you installed both Apache and PHP from RPM packages, 
      you need to uncomment or add some or all of the following lines
      in your http.conf file:
      <programlisting>
# Extra Modules
AddModule mod_php.c
AddModule mod_php3.c
AddModule mod_perl.c

# Extra Modules
LoadModule php_module         modules/mod_php.so
LoadModule php3_module        modules/libphp3.so     /* for PHP 3 */
LoadModule php4_module        modules/libphp4.so     /* for PHP 4 */
LoadModule perl_module        modules/libperl.so
      </programlisting>
      And add:
      <programlisting>
AddType application/x-httpd-php3 .php3    /* for PHP 3 */
AddType application/x-httpd-php .php      /* for PHP 4 */
      </programlisting>
      ... to the global properties, or to the properties of the 
      VirtualDomain you want to have PHP support added to.
     </para>
    </answer>
   </qandaentry>

   <qandaentry id="faq.installation.compile">
    <question>
     <para>
      I installed PHP using RPMS, but it doesn't compile with the database 
      support I need! What's going on here?
     </para>
    </question>
    <answer>
     <para>
      Due to the way PHP is currently built, it is not easy to build a
      complete flexible PHP RPM.  This issue will be addressed in PHP 4.
      For PHP, we currently suggest you use the mechanism described in the
      INSTALL.REDHAT file in the PHP distribution.  If you insist on using
      an RPM version of PHP, read on...
    </para>
    <para>
      Currently the RPM packagers are setting up the RPMS to install
      without database support to simplify installations <emphasis>and</emphasis>
      because RPMS use /usr/ instead of the standard /usr/local/ directory for
      files.  You need to tell the RPM spec file which databases to support
      and the location of the top-level of your database server.
    </para>
    <para>
      This example will explain the process of adding support for the
      popular MySQL database server, using the mod installation for Apache.
    </para>
    <para>
      Of course all of this information can be adjusted for any database
      server that PHP supports.  We will assume you installed MySQL and Apache
      completely with RPMS for this example as well.
      <itemizedlist>
           <listitem>
            <para>
          First remove mod_php3 : 
          <programlisting>
rpm -e mod_php3
          </programlisting>
             </para>
           </listitem>
           <listitem>
            <para>
             Then get the source rpm and INSTALL it, NOT --rebuild
          <programlisting>
rpm -Uvh mod_php3-3.0.5-2.src.rpm
          </programlisting>
             </para>
           </listitem>
           <listitem>
            <para>
             Then edit the <filename>/usr/src/redhat/SPECS/mod_php3.spec</filename> 
file
            </para>
            <para>
        In the %build section add the database support you want, and the path.
            </para>
            <para>
         For MySQL  you would add 
         <programlisting>
--with-mysql=/usr \
         </programlisting>
         The %build section will look something like this:
         <programlisting>
        ./configure --prefix=/usr \
        --with-apxs=/usr/sbin/apxs \
        --with-config-file-path=/usr/lib \
        --enable-debug=no \
        --enable-safe-mode \
        --with-exec-dir=/usr/bin \
        --with-mysql=/usr \
        --with-system-regex
         </programlisting>
             </para>
           </listitem>
           <listitem>
            <para>
             Once this modification is made then build the binary rpm as follows:
         <programlisting>
rpm -bb /usr/src/redhat/SPECS/mod_php3.spec
        </programlisting>
             </para>
           </listitem>
           <listitem>
            <para>
             Then install the rpm
         <programlisting>
rpm -ivh /usr/src/redhat/RPMS/i386/mod_php3-3.0.5-2.i386.rpm
        </programlisting>
           </para>
          </listitem>
     </itemizedlist>
     Make sure you restart Apache, and you now have PHP with MySQL support
     using RPM's.  Note that it is probably much easier to just build
     from the distribution tarball of PHP and follow the instructions in
     <filename>INSTALL.REDHAT</filename> found in that distribution.
         </para>
    </answer>
   </qandaentry>
  
   <qandaentry id="faq.installation.libraries">
    <question>
     <para>
      How do I get these libraries to work?
     </para>
    </question>
    <answer>
     <para>
     </para>
    </answer>
   </qandaentry>
  </qandaset>
 </chapter>

 <!-- Keep this comment at the end of the file
 Local variables:
 mode: sgml
 sgml-omittag:t
 sgml-shorttag:t
 sgml-minimize-attributes:nil
 sgml-always-quote-attributes:t
 sgml-indent-step:1
 sgml-indent-data:t
 sgml-parent-document:nil
 sgml-default-dtd-file:"../../manual.ced"
 sgml-exposed-tags:nil
 sgml-local-catalogs:nil
 sgml-local-ecat-files:nil
 End:
 -->
  

Reply via email to