|
Apache 1.3.x on Microsoft WindowsThis section contains notes and hints specific to Apache 1.3.x installs of PHP on Microsoft Windows systems. There are also instructions and notes for Apache 2 on a separate page.
Note:
Please read the manual installation steps first!
There are two ways to set up PHP to work with Apache 1.3.x
on Windows. One is to use the CGI binary ( 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. 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. After changing the configuration file, remember to restart the server, for example, NET STOP APACHE followed by NET START APACHE, if you run Apache as a Windows Service, or use your regular shortcuts.
Note:
Remember that when adding
path values in the Apache configuration files on Windows, all backslashes
such as
You should add the following lines to your Apache Example 4.3. PHP as an Apache 1.3.x module
This assumes PHP is installed to For PHP 4: # Add to the end of the LoadModule section For PHP 5: # Add to the end of the LoadModule section For both: # Add this line inside the <IfModule mod_mime.c> conditional brace
If you unzipped the PHP package to Example 4.4. PHP and Apache 1.3.x as CGIScriptAlias /php/ "c:/php/"
Warning:
By using the CGI setup, your server is open to several possible attacks. Please read our CGI security section to learn how to defend yourself from those attacks.
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 highlight_file() function. To
do this simply create a PHP script file and add this code:
Code Examples / Notes » install.windows.apache1bcarr
To Besta and 'j dot b..dot sk': 'Add Module mod_php4.c' or 'AddModule mod_php5.c' may or may not be necessary depending on your environment and version of Apache. In my situation, this add module DID NOT work or it wasn't necessary. The LoadModule was enough to do the trick. I tried it with PHP4 on Apache 1.3.34 and Apache 2.0. All in all, your notes have been helpful. Thanks. psychosos
Please note that the SetEnv PHPRC "directory/to/phpini/" only works when using PHP as CGI, but _not_ when you use the PHP Apache Module!
27-aug-2005 09:51
On contrary to user "Besta"'s post AddModule mod_php5.c should be added to the addmodule section. I installed php5 and apache 1.3.3 and without the above line it is not recognizing the .php files david
Note that if you place php in the c:\php5 director your ScriptAlias line should read ScriptAlias /php/ "c:/php5/" This may be obvious to regular Apache users, but I changed all sorts of things around before realizing this was the issue. I thought Action application/x-httpd-php "/php/php-cgi.exe" was a path and was changing it to "/php5/php-cgi.exe" which didn't work. j dot b
DO NOT FORGET to add "index.php" into <IfModule mod_dir.c> DirectoryIndex index.html </IfModule> so you get index.php processed;multiple values separate by space: <IfModule mod_dir.c> DirectoryIndex index.html index.php </IfModule> besta
Do not add this line to apache http.conf. It does not work. AddModule mod_php5.c Also, remember to edit the system variables, edit the PATH and add the path to the php directory and restart windows. |
Change LanguageWindows Installer (PHP 5.2 and later) Windows Installer (PHP 5.1.0 and earlier) Manual Installation Steps ActiveScript Microsoft IIS / PWS Apache 1.3.x on Microsoft Windows Apache 2.0.x on Microsoft Windows Sun OmniHTTPd Server Sambar Server on Microsoft Windows Xitami on Microsoft Windows Building from source Installation of extensions on Windows |