File: apache1.xml

package info (click to toggle)
phpdoc 20050512-1
  • links: PTS
  • area: non-free
  • in suites: sarge
  • size: 36,592 kB
  • ctags: 1,501
  • sloc: xml: 376,768; php: 6,708; cpp: 500; makefile: 293; perl: 161; sh: 151; awk: 28
file content (166 lines) | stat: -rw-r--r-- 5,267 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.16 $ -->
   <sect1 id="install.windows.apache1">
    <title>Apache 1.3.x on Microsoft Windows</title>
    <para>
     This section contains notes and hints specific to Apache 1.3.x installs
     of PHP on Microsoft Windows systems. There are also
     <link linkend="install.windows.apache2">instructions and notes
     for Apache 2</link> on a separate page.
    </para>
    <note>
     <para>
      Please read the <link linkend="install.windows.manual">manual
      installation steps</link> first!
     </para>
    </note>
    
    <simpara>
     There are two ways to set up PHP to work with Apache 1.3.x
     on Windows. One is to use the CGI binary (<filename>php.exe</filename>
     for PHP 4 and <filename>php-cgi.exe</filename> for PHP 5),
     the other is to use the Apache Module DLL. In either case
     you need to edit your &httpd.conf; to configure Apache to
     work with PHP, and then restart the server.
    </simpara>
    
    <simpara>
     It is worth noting here that now the SAPI module has been 
     made more stable under Windows, we recommend it's use above
     the CGI binary, since it is more transparent and secure.
    </simpara>
    
    <simpara>
     Although there can be a few variations of configuring PHP
     under Apache, these are simple enough to be used by the
     newcomer. Please consult the Apache Documentation for further
     configuration directives.
    </simpara>
  
    <simpara>
     After changing the configuration file, remember to restart the server, for
     example, <command>NET STOP APACHE</command> followed by
     <command>NET START APACHE</command>, if you run Apache as a Windows
     Service, or use your regular shortcuts.
    </simpara>
    
    &note.apache.slashes;

    <sect2 id="install.windows.apache1.module">
     <title>Installing as an Apache module</title>
     <para>
      You should add the following lines to your Apache &httpd.conf; file:
     </para>
     <para>
      <example>
       <title>PHP as an Apache 1.3.x module</title>
        <para>
         This assumes PHP is installed to <filename>c:\php</filename>. Adjust the
         path if this is not the case.
        </para>
        <para>
         For PHP 4:
        </para>
        <programlisting role="apache-conf">
<![CDATA[
# Add to the end of the LoadModule section
# Don't forget to copy this file from the sapi directory!
LoadModule php4_module "C:/php/php4apache.dll"

# Add to the end of the AddModule section
AddModule mod_php4.c
]]>
       </programlisting>
       <para>
        For PHP 5:
       </para>
       <programlisting role="apache-conf">
<![CDATA[
# Add to the end of the LoadModule section
LoadModule php5_module "C:/php/php5apache.dll"

# Add to the end of the AddModule section
AddModule mod_php5.c
]]>
       </programlisting>
       <para>
        For both:
       </para>
       <programlisting role="apache-conf">
<![CDATA[
# Add this line inside the <IfModule mod_mime.c> conditional brace
AddType application/x-httpd-php .php

# For syntax highlighted .phps files, also add
AddType application/x-httpd-php-source .phps
]]>
       </programlisting>
      </example>
     </para>
    </sect2>

    <sect2 id="install.windows.apache1.cgi">
     <title>Installing as a CGI binary</title>
    
     <para>
      If you unzipped the PHP package to <filename>C:\php\</filename> as described
      in the <link linkend="install.windows.manual">Manual
      Installation Steps</link> section, you need to insert
      these lines to your Apache configuration file to set
      up the CGI binary:
      <example>
       <title>PHP and Apache 1.3.x as CGI</title>
        <programlisting role="apache-conf">
<![CDATA[
ScriptAlias /php/ "c:/php/"
AddType application/x-httpd-php .php

# For PHP 4
Action application/x-httpd-php "/php/php.exe"

# For PHP 5
Action application/x-httpd-php "/php/php-cgi.exe"

# specify the directory where php.ini is
SetEnv PHPRC C:/php
]]>
       </programlisting>
      </example>
      Note that the second line in the list above can be found
      in the actual versions of &httpd.conf;, but it is commented out. Remember
      also to substitute the <filename>c:/php/</filename> for your actual path to
      PHP.
     </para>
     &warn.install.cgi;
     <simpara>
      If you would like to present PHP source files syntax highlighted, there
      is no such convenient option as with the module version of PHP.
      If you chose to configure Apache to use PHP as a CGI binary, you
      will need to use the <function>highlight_file</function> function. To
      do this simply create a PHP script file and add this code: 
      <literal>&lt;?php highlight_file('some_php_script.php'); ?&gt;</literal>.
     </simpara>
    </sect2>

   </sect1>

<!-- 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
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->