Rusty wrote:
> Stuff that's in /php should entirely bypass the scoop handler. And if
> hitting a php script just tries to send the script text straight
> through, then that is what's happening. It sounds like apache doesn't
> know what to do with php here. I double checked, and the AddType
> *should* be all you have to do, as long as Apache's got php in it. Of
> course, that doesn't make sense, because if you put in the SetHandler,
> then they all get run as PHP. So we know PHP is there.
>
> Although I feel like it shouldn't be necessary, you might try adding a
> section like:
>
> <Files *.php>
>   SetHandler application/x-httpd-php
> </Files>
>
> I think this would be at the same level in your config as the Location
> sections. That should force it to handle .php files with the php engine.
> It really shouldn't be needed, but if it works...?
>   
(Oops, forgot to send the last message through the help list...)

Alright, gave that a try, and it still refuses to work!  This is truly 
mysterious.  Is there maybe some sort of tracing utility, so we can find 
out what apache's thinking?

I'm starting to think that the configuration file has no effect, but 
that's not true, because changing the AddType to "AddType 
application/wtf .php" actually makes the server return php files as 
Content-Type: application/wtf

This is truly perplexing!

- Max

>
> --R
>
> On Fri, 2006-08-25 at 16:23 -0400, Maxime Romano wrote:
>   
>> Rusty wrote:
>>     
>>> You might try:
>>>
>>>   AddType application/x-httpd-php .php
>>>
>>> (assuming your php files are named [whatever].php) instead of the
>>> SetHandler. I would also put SetHandler default-handler in there so
>>> mod_perl doesn't try to run stuff. I checked the config of a site where
>>> PHP runs under scoop, and that's (mostly) how it's set up. The only
>>> other difference is that site runs the php through a proxy apache before
>>> requests even get to the scoop handling mod_perl apache. I don't know if
>>> that will make a difference or not, but my guess is the AddType above,
>>> combined with default-handler will do it for you.
>>>
>>>   
>>>       
>> Thanks for the quick reply!
>>
>> Alright, I just tried that, and it doesn't seem to work. Now, it no 
>> longer interprets .php files, it just sends them wholesale as 
>> application/x-httpd-php.  The good news is that CSS files are coming out 
>> as text/css, as are jpeg files coming as image/jpg.  This strikes me as 
>> odd, because the server seems to know very well was kind of file it is: 
>> it just refuses to pass it onto PHP. Maybe there's an additional 
>> declaration to put in that explicitly instructs the server to run those 
>> files through PHP?
>>
>> Other than that, looking at it, it seems that either the SetHandler 
>> perl-script declaration is clobbering the PHP interpreter somehow, in 
>> which case the only solution would probably be the proxy thing; or maybe 
>> that this snippet of scoop code  in ApacheHandler.pm isn't being nice to 
>> the apache server:
>>    
>>     unless ($S->{OPS}->{$op} && $S->{OPS}->{$op}->{enabled}) {
>>         $S->cleanup();
>>         undef $Scoop::_instance;
>>         return $Scoop::MP2 ? &Apache::DECLINED : 
>> &Apache::Constants::DECLINED;
>>     }
>>
>> Then again, I don't know enough about how apache deals with requests to 
>> determine whether that could be an issue.
>>
>> I greatly appreciate the help, BTW!
>>
>> - Max
>>     
>>> --R
>>>
>>>
>>> On Fri, 2006-08-25 at 15:07 -0400, Maxime Romano wrote:
>>>   
>>>       
>>>> Hi everyone,
>>>>
>>>> I'm trying to install some PHP application on my server under Scoop's
>>>> tree, such that scoop resides at http://www.example.com/ and the PHP
>>>> scripts at http://www.example.com/php/.
>>>>
>>>> So, the solution I've found so far is to stick all the PHP scripts under
>>>> $scoopdir/html/php/, then add the following to my httpd.conf:
>>>>
>>>>   <Location /php>
>>>>         SetHandler application/x-httpd-php
>>>>   </Location>
>>>>
>>>> This works, but has the (serious) drawback of making the PHP interpreter
>>>> parse every file.  Now, this isn't particularly tragic, but then every
>>>> file under http://www.example.com/php/ gets sent with a "text/html"
>>>> content-type, which is terrible, because then images don't get sent
>>>> right, and nor do CSS files get accepted. So, in trying to give CSS
>>>> files the proper content-type, I've attempted many different
>>>> combinations of AddHandler, RemoveHandler and AddType for the last few
>>>> hours.  There are generally only two outcomes: either I put SetHandler
>>>> application/x-httpd-php in and everything gets interpreted as PHP, or I
>>>> don't and nothing gets interpreted (which is obviously incorrect).
>>>>
>>>> Now, the scoop install itself is running on a Virtual Server on an
>>>> apache site which hosts many other PHP-based sites without any problem
>>>> or special httpd.conf settings whatsoever.  So it's not PHP's fault.
>>>> Furthermore, scoop has been in use for the longest time, and I'm
>>>> convinced that the mod_perl is properly installed and configured, as
>>>> well. So it's not scoop's fault either.
>>>>
>>>> The culprit seems to be me :)
>>>>
>>>> So, either I'm doing it completely wrong, or maybe it's impossible, or
>>>> maybe my strategy is just bad. Anyway, if anyone knows anything about
>>>> this and could shed some light on my predicament, I would be immensely
>>>> grateful.
>>>>
>>>> - Max
>>>>
>>>> This is the relevant portion of my httpd.conf :
>>>>
>>>> <VirtualHost 10.10.10.10>
>>>>   ServerAlias www.example.com
>>>>   ServerName www.example.com
>>>>   DocumentRoot /home/example/scoop/html
>>>>
>>>>   User example
>>>>   Group example
>>>>
>>>>   <perl>
>>>>     use lib qw( /home/example/scoop/lib );
>>>>   </perl>
>>>>
>>>>   PerlModule ModPerl::Test
>>>>   <Location />
>>>>      SetHandler perl-script
>>>>         PerlSetVar DBType mySQL
>>>>         PerlSetVar mysql_version 4.0
>>>>         PerlSetVar db_name example
>>>>         PerlSetVar db_host localhost
>>>>         PerlSetVar db_user example
>>>>         PerlSetVar db_pass hackme
>>>>     <perl>
>>>>       my $vfile = '/home/example/scoop/VERSION';
>>>>       my $v = do $vfile;
>>>>       push(@{ $Location{'/'}->{PerlSetVar} },
>>>>          [ scoop_version  => $v->{Version}  ],
>>>>          [ scoop_date     => $v->{Date}     ],
>>>>                  [ scoop_revision => $v->{Revision} ],
>>>>          [ scoop_author   => $v->{Author}   ],
>>>>              [ scoop_state    => $v->{State}    ]
>>>>           );
>>>>     </perl>
>>>>         PerlSetVar cookie_host .example.com
>>>>         PerlSetVar SMTP localhost
>>>>         PerlSetVar site_id example
>>>>         PerlSetVar site_key hackmehackmehackme
>>>>         PerlSetVar dbdown_page /pages/dbdown.html
>>>>         PerlRequire /home/example/scoop/etc/startup.pl
>>>>      PerlHandler Scoop::ApacheHandler
>>>>   #   PerlSendHeader On
>>>>   </Location>
>>>>
>>>> <Location /images>
>>>>     SetHandler default-handler
>>>>   </Location>
>>>>
>>>>   <Location /pages>
>>>>     SetHandler default-handler
>>>>   </Location>k
>>>>
>>>>   <Location /php>
>>>>         SetHandler application/x-httpd-php
>>>>   </Location>
>>>>
>>>>   <Location ~ "^/(robots\.txt|favicon\.ico)$">
>>>>     SetHandler default-handler
>>>>   </Location>
>>>>   Alias /files/ /home/example/scoop/files/
>>>>   Alias /adminfiles/ /home/example/scoop/adminfiles/
>>>>   ErrorDocument  404 /pages/404.html
>>>>   ErrorDocument 500 /pages/500.html
>>>> #Alias /wiki /home/example/scoop/wiki/index.php
>>>> #Alias /index.php /home/example/scoop/wiki/index.php
>>>>
>>>> </VirtualHost>
>>>>
>>>> Apache version is 1.3.37 on Fedora Core 2
>>>>
>>>>
>>>> _______________________________________________
>>>> Scoop-help mailing list
>>>> Scoop-help at lists.kuro5hin.org
>>>> http://lists.kuro5hin.org/mailman/listinfo/scoop-help
>>>>     
>>>>         
>>> _______________________________________________
>>> Scoop-help mailing list
>>> Scoop-help at lists.kuro5hin.org
>>> http://lists.kuro5hin.org/mailman/listinfo/scoop-help
>>>
>>>
>>>   
>>>       
>>     
>
>
>
>