NYCPHP Meetup

NYPHP.org

[nycphp-talk] Config Problems, Apache-PHP on Windows

kirill at kptek.com kirill at kptek.com
Tue Dec 17 19:04:57 EST 2002


Jessica,

You need to check the httpd.conf ( which you should find in the directory 
called "conf" in the Apache install directory).  This is the file where 
you add the line 

 AddType application/x-httpd-php .php

If you want   PHP to parse other extensions, add more of the above lines 
but change the last part ( .php) to the extension of your choice. 

Kirill



Oktay Altunergil <nyphp at altunergil.com> 
12/17/2002 05:45 PM
Please respond to
talk at nyphp.org


To
NYPHP Talk <talk at nyphp.org>
cc

Subject
Re: [nycphp-talk] Config Problems, Apache-PHP on Windows






Jessica,

"server-parsed" is not the setting you should be modifying. Like Dan said, 
what you need to do is to add 

AddType application/x-httpd-php .php
Action application/x-httpd-php "/phpdir/php.exe"
ScriptAlias /phpdir/ "c:/Program Files/php/"

which has the effect of associating the .php extension with the 
x-httpd-php mime time which in turn will be handled by php.exe.

If you put .php in the 'server-parsed' setting Apache will try to *handle* 
it as if it was a server side include (i think that's what server-parsed 
is for) and not as php. Make sure you remove .php from that line. You can 
also add other extensions such as
 .php4, .phtml etc but you should do that in the section i've described 
above.

oktay



On Tue, 17 Dec 2002 17:35:20 -0500
jessica kelly <jkelly at sussex.cc.nj.us> wrote:

> Hi Dan,
> 
> I added/changed what you suggested. I'm still having problems though.
> 
> I have mucked around with the below section hoping to get things going 
but to no avail.
> 
> >>>
>     # To use server-parsed HTML files
>     #
>     AddType text/html .shtml .htm .inc
>     AddHandler server-parsed .shtml .htm .inc .php
>     #
> >>>>
> If I change " AddType text/html .shtml .htm .inc"  and "AddHandler 
server-parsed .shtml .htm .inc" to not include .php I get a "Bad Request 
Error".
> 
> If I add .php to "AddType text/html .shtml .htm .inc [.php]" I get a 
page with <? phpinfo(); ?> in the source code but nothing else.
> 
> If I keep .php in "AddType text/html .shtml .htm .inc [.php]" and add 
.php to "AddHandler server-parsed .shtml .htm .inc [.php]" I get the same 
error as above (I get a page with <? phpinfo(); ?> in the source code but 
nothing else.)
> 
> If I get rid of .php in "AddType text/html .shtml .htm .inc" and Keep 
.php to "AddHandler server-parsed .shtml .htm .inc [.php]" the server 
wants to download the page to the computer rather than displaying the 
phpinfo();
> 
> All this said I don't think that the above in any form is the answer but 
maybe a clue as to the cause.
> 
> If someone would like to paruse the .conf file let me know & I will send 
a copy to you.
> 
> Thank's
> 
> Jessica
> 
> >>> danielc at analysisandsolutions.com 12/17/02 2:03:20 PM >>>
> Hi Jessica:
> 
> On Tue, Dec 17, 2002 at 12:19:28PM -0500, jessica kelly wrote:
> 
> > I'm trying to get Apache 1.3.26 and PHP 4.2.3 setup on my win 
production
> > computer
> > ... snip ...
> > "You have chosen to download a file of type: application/x-httpd-php
> > from 127.0.0.1/a/test.php"
> 
> Modify your httpd.conf file...
> 
> AddType application/x-httpd-php .php
> Action application/x-httpd-php "/phpdir/php.exe"
> ScriptAlias /phpdir/ "c:/Program Files/php/"
> 
> Tweak paths as appropraite for your system.
> 
> --Dan
> 
> -- 
>  The new Department of Homeland Security is exempt from:
>     * the Freedom of Information Act   * procurement rules
>     * labor collective bargaining      * whistle blower protection
>  The real goal?  Eliminating government accountability.
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 


--- Unsubscribe at http://nyphp.org/list/ ---





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20021217/1d129423/attachment.html>


More information about the talk mailing list