|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[1999-03-06 12:53 UTC] eschmid
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Fri Jan 02 04:00:01 2026 UTC |
Here's an exchange from the php mailing list, which I initiated. It points out that the available documentation on how to modify Apache's httpd.conf file is wrong. It would also be useful to point out the correct way to set doc_root in php3.ini. --------------------------------------------------------------------------------------- I've installed Apache 1.3.4 on Win98 and it's running fine. I've installed PHP 3.0.6, and I can't get it to work with Apache at all. I followed the installation directions, modifying both httpd.conf as follows: ScriptAlias /php3/ C:/progra~1/php/php.exe AddType application/x-httpd-php3 .php3 AddType application/x-httpd-php3 .phtml Action application/x-httpd-php3 c:/progra~1/php/php.exe If I try loading http://my_server/phptest/hello_php.phtml, I get this output in my browser: Bad Request Your browser sent a request that this server could not understand. Invalid URI in request GET /phptest/hello_php.phtml HTTP/1.0 The phtml file has straight html (no php extensions). If I rename the file to hello_php.html, everything works fine. What am I doing wrong? .................................................................................... Rasmus Lerdorf wrote: > > > ScriptAlias /php3/ C:/progra~1/php/php.exe > > That line doesn't look right to me. It should probably look something > like: > > ScriptAlias /php3/ /progra~1/php/ > > > AddType application/x-httpd-php3 .php3 > > AddType application/x-httpd-php3 .phtml > > Action application/x-httpd-php3 c:/progra~1/php/php.exe > > And then here use: > > Action application/x-httpd-php3 /php3/php.exe Jason Brooke wrote: > > How come you're setting the Action application to the full physical path > when you've already aliased it to /php ? > > Try changing it to: Action application/x-httpd-php3 "/php/php.exe" My information comes from the PHP docs (file:///C|/Program Files/PHP/doc/install-windows95-nt.html after I installed the doc on my local disk): ScriptAlias /php3/ "c:/path-to-php-dir/php.exe" AddType application/x-httpd-php3 .php3 AddType application/x-httpd-php3 .phtml Action application/x-httpd-php3 "php3/php.exe" The same page references http://www.umesd.k12.or.us/php/win32install.html for the latest information, and that page says this: ScriptAlias /php3/ "c:/path-to-php-dir/" AddType application/x-httpd-php3 .php3 AddType application/x-httpd-php3 .phtml Action application/x-httpd-php3 "/php3/php.exe" The first ScriptAlias setting didn't make sense to me either, but I'm new to this so what do I know. I finally got it to work. I had to do this: ScriptAlias /php3/ /progra~1/php/ AddType application/x-httpd-php3 .php3 AddType application/x-httpd-php3 .phtml Action application/x-httpd-php3 /php3/php.exe Notice that the Action specifies /php3/php.exe, not /php/php.exe. I also had to set doc_root to the root directory for my web site; I was initially thrown by the variable's name. I thought "root of the php pages" meant PHPs HTML documentation. Now that I have it working, can someone please explain why it works? In particular: - The comment on ScriptAlias in httpd.doc says this: "ScriptAlias: This controls which directories contain server scripts." This doesn't appear to be true; /progra~1/php/ is the root of my PHP installation. Is the comment just wrong? (The comment appears to be correct for cgi-bin.) - Why is /php3/php.exe correct for Action? I have no directory named php3. Does the /php3/ part of Action refer to the ScriptAlias? (Putting those two together would point to php.exe.)