mirror of
https://github.com/macintoshplus/doc-en.git
synced 2026-03-28 10:52:18 +01:00
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@175877 c90b9560-bf6c-de11-be94-00142212c4b1
166 lines
5.1 KiB
XML
166 lines
5.1 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.15 $ -->
|
|
<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>
|
|
|
|
¬e.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
|
|
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><?php highlight_file('some_php_script.php'); ?></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
|
|
-->
|