note 21094 added to faq.installation
| From: | csaba at alum dot mit dot edu | Date: | Mon, 29 Apr 2002 05:07:03 +0000 |
| Subject: | note 21094 added to faq.installation | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-29964@lists.php.net to get a copy of this message | ||
Perhaps this will save someone the hours that it cost me to figure out how to go from a CGI version
of PHP (through 4.2) to a module version on Apache 2 for Win2K:
I've had a CGI versions of PHP 4 through several releases of Apache and the setup for that is
really easy (assuming they both individually work):
0. Review php.ini (engine = On, et. al)
1. Move php4ts.dll into appropriate windows subdirectory (for me it's System32).
The remaining 4 items are changes/additions to Apache's httpd.conf file:
2. Put index.php as the first argument to DirectoryIndex if you want Apache to automatically pick up
index.php files
Now add the following 3 lines:
3. AddType application/x-httpd-php .php
4. Action application/x-httpd-php "/php4/php.exe"
5. ScriptAlias /php4/ "c:/winapps/php/4.2/sapi/"
3 is so Apache will know .php files are special. 4 is so Apache will know what special program to
run when it realizes it has a (.php) special file. 5 is so that Apache will know what directory that
special program (php.exe) lives in.
To go from the CGI to the Module version should be even simpler, right? But there is a HUGE gotcha.
It's one of those You can't get there from here syndromes if you are using Apache 2.0.28
(or earlier, I presume). I needed to upgrade to 2.0.35 so that the required php (4.2) provided
apache2filter.dll file would work with Apache2.
So the final steps are as follows:
Do steps 0-3 as written above.
If you are upgrading, not installing, then back out steps 4 and 5 from above.
4) Add a line to the httpd.conf file:
LoadModule php4_module c:/winapps/php/4.2/experimental/apache2filter.dll
NOTE that this is not the php4apache.dll file of yore in the sapi directory (which I presume would
work if you were doing this with Apache 1.3.x)
--
http://www.php.net/manual/en/faq.installation.php
http://master.php.net/manage/user-notes.php?action=edit+21094
http://master.php.net/manage/user-notes.php?action=delete+21094
http://master.php.net/manage/user-notes.php?action=reject+21094