You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by innocent <in...@tauraizimbabwe.com> on 2003/12/09 14:27:22 UTC

[users@httpd] PHP files being downloaded instead of running

hie

I have installed php and it works fine, but when i try to run some php files 
I have created they don.t run but they try to be downloaded instead. what 
should I do


Thank you

Innocent Muchedzi
tele:: 795541/795562

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] PHP files being downloaded instead of running

Posted by Luis Moreira <lu...@esinnovation.pt>.
    Installing PHP is one thing, telling Apache how to handle those scripts
is another, since (on Windows) it is not automatic.
    Did you edit httpd.conf accordingly ?
    You should find something like

    #
    # ScriptAlias: This controls which directories contain server scripts.
    # ScriptAliases are essentially the same as Aliases, except that
    # documents in the realname directory are treated as applications and
    # run by the server when requested rather than as documents sent to the
client.
    # The same rules about trailing "/" apply to ScriptAlias directives as
to
    # Alias.
    #
    # ScriptAlias /cgi-bin/ "d:/program files/Apache Group/Apache/cgi-bin/"

    #
    # AddType allows you to tweak mime.types without actually editing it, or
to
    # make certain files to be certain types.
    #
    AddType application/x-httpd-php .php .phtml
    AddType application/x-httpd-php-source .phps

    #
    # "d:/program files/Apache Group/Apache/cgi-bin" should be changed to
whatever your ScriptAliased
    # CGI directory exists, if you have that configured.
    #
    # <Directory "d:/program files/Apache Group/Apache/cgi-bin">

#
# Action lets you define media types that will execute a script whenever
# a matching file is called. This eliminates the need for repeated URL
# pathnames for oft-used CGI file processors.
# Format: Action media/type /cgi-script/location
# Format: Action handler-name /cgi-script/location
#
# Where PHP.exe is located
#
    Action application/x-httpd-php /php/php.exe


Luis

----- Original Message -----
From: "innocent" <in...@tauraizimbabwe.com>
To: <us...@httpd.apache.org>
Sent: Tuesday, December 09, 2003 1:27 PM
Subject: [users@httpd] PHP files being downloaded instead of running


> hie
>
> I have installed php and it works fine, but when i try to run some php
files
> I have created they don.t run but they try to be downloaded instead. what
> should I do
>
>
> Thank you
>
> Innocent Muchedzi
> tele:: 795541/795562
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org