You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Daryl Williams <da...@weblane.com> on 2002/08/22 16:40:28 UTC

config question regarding

folks,

i have a  mod_perl Apache::Registry script running from
<Location>/foo</Location>, which appears to work ok,  however
i am also reying to stash other program related data, forms, etc.
under the same namespace, i.e. /foo/forms, which also seems
to be working (for regular .html files) except for the one reason
why i am wring to the list.

i would like to be able to use php or other interpreters to generate
some simple dynamic content. however when i try to load the php
file, apache thinks i want to download the file. the file is recognized
correctly by apache as "application/x-httpd-php" in the download box.
btw, php does work correctly under the documnet_root.

following is the config info. your help is greatly appreciated.
rtfms welcomed, especially with a hint to it's location.

Alias /foo/forms   "/foo/path/to/forms"
Alias /foo

<Location  /foo>
  SetHandler          perl-script
  perlHandler        Apache::Registry
  perlSendHeader  On
  DirectoryIndex  welcome
  Options             +ExecCGI
  PerlSetEnv        STYLESHEET /foo/lib/style.css
</Location>

<Location "/helpdesk/forms/">
SetHandler default-handler
AddType application/x-httpd-php .phtml
</Location>

tia,

daryl



---------------------------------------------------------------------
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: config question regarding

Posted by "J. Greenlees" <ja...@shaw.ca>.
running php as a server mod yyou do also need:

Include  conf/addon-modules/php.conf
may need to also have the addtype application, though that is usually 
for php as an eceutable not module


Daryl Williams wrote:

> Jacob, thanks for your reply. i moved the php LoadModule
> directive to the end of that section, i.e. it's now the last module
> loaded, but the file is still not being interpreted correctly.
> if i try to retrieve it with a browser it wants to save it to file.
> if i telnet to port 80 and do a get, i get straight html. so it seems
> my browser (moz) knows nothing 'bout php, which makes sense
> but the server is not handing it to the php interpreter either. which
> it does correctly under the docroot but not this <Location>.
>
> does anyone know if there is a specific handler for php?
> i had to specifically add a "SetHandle default-handler" to
> my forms <Location> config directive to override the mod_perl
> handler, and now i can't get that location to serve more
> than one filetype at a time.
>
> thanks again for any help.
>
> daryl
>
> Jacob Coby wrote:
>
>>> i would like to be able to use php or other interpreters to generate
>>> some simple dynamic content. however when i try to load the php
>>> file, apache thinks i want to download the file. the file is recognized
>>> correctly by apache as "application/x-httpd-php" in the download box.
>>> btw, php does work correctly under the documnet_root.
>>>
>>> following is the config info. your help is greatly appreciated.
>>> rtfms welcomed, especially with a hint to it's location.
>>>   
>>
>>
>> Since it works elsewhere, and you are getting the x-httpd-php mime type,
>> check the order that you are adding the php module.  I had problems 
>> with php
>> + openssl where, due to the ordering of AddModule, php never actually
>> received the file to serve up, instead apache returned the unparsed 
>> php file
>> to the browser, which wanted to download it.
>>
>> Be absolutly sure that php is the last module in the list to be 
>> added.  ie:
>>
>> [..]
>> AddModule mod_so.c
>> AddModule mod_setenvif.c
>>
>> <IfDefine SSL>
>> AddModule mod_ssl.c
>> </IfDefine>
>>
>> AddModule mod_php4.c
>> [..]
>>
>> -Jacob
>> http://www.listingbook.com
>>
>>
>> ---------------------------------------------------------------------
>> 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
>
>




---------------------------------------------------------------------
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: config question regarding

Posted by Daryl Williams <da...@weblane.com>.
Jacob, thanks for your reply. i moved the php LoadModule
directive to the end of that section, i.e. it's now the last module
loaded, but the file is still not being interpreted correctly.
if i try to retrieve it with a browser it wants to save it to file.
if i telnet to port 80 and do a get, i get straight html. so it seems
my browser (moz) knows nothing 'bout php, which makes sense
but the server is not handing it to the php interpreter either. which
it does correctly under the docroot but not this <Location>.

does anyone know if there is a specific handler for php?
i had to specifically add a "SetHandle default-handler" to
my forms <Location> config directive to override the mod_perl
handler, and now i can't get that location to serve more
than one filetype at a time.

thanks again for any help.

daryl

Jacob Coby wrote:

>>i would like to be able to use php or other interpreters to generate
>>some simple dynamic content. however when i try to load the php
>>file, apache thinks i want to download the file. the file is recognized
>>correctly by apache as "application/x-httpd-php" in the download box.
>>btw, php does work correctly under the documnet_root.
>>
>>following is the config info. your help is greatly appreciated.
>>rtfms welcomed, especially with a hint to it's location.
>>    
>>
>
>Since it works elsewhere, and you are getting the x-httpd-php mime type,
>check the order that you are adding the php module.  I had problems with php
>+ openssl where, due to the ordering of AddModule, php never actually
>received the file to serve up, instead apache returned the unparsed php file
>to the browser, which wanted to download it.
>
>Be absolutly sure that php is the last module in the list to be added.  ie:
>
>[..]
>AddModule mod_so.c
>AddModule mod_setenvif.c
>
><IfDefine SSL>
>AddModule mod_ssl.c
></IfDefine>
>
>AddModule mod_php4.c
>[..]
>
>-Jacob
>http://www.listingbook.com
>
>
>---------------------------------------------------------------------
>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


Re: config question regarding

Posted by Jacob Coby <jc...@listingbook.com>.
> i would like to be able to use php or other interpreters to generate
> some simple dynamic content. however when i try to load the php
> file, apache thinks i want to download the file. the file is recognized
> correctly by apache as "application/x-httpd-php" in the download box.
> btw, php does work correctly under the documnet_root.
>
> following is the config info. your help is greatly appreciated.
> rtfms welcomed, especially with a hint to it's location.

Since it works elsewhere, and you are getting the x-httpd-php mime type,
check the order that you are adding the php module.  I had problems with php
+ openssl where, due to the ordering of AddModule, php never actually
received the file to serve up, instead apache returned the unparsed php file
to the browser, which wanted to download it.

Be absolutly sure that php is the last module in the list to be added.  ie:

[..]
AddModule mod_so.c
AddModule mod_setenvif.c

<IfDefine SSL>
AddModule mod_ssl.c
</IfDefine>

AddModule mod_php4.c
[..]

-Jacob
http://www.listingbook.com


---------------------------------------------------------------------
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