Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Apache: Users

MultiViews on PHP files not working

 

 

Apache users RSS feed   Index | Next | Previous | View Threaded


jengelh at computergmbh

Oct 27, 2007, 5:01 AM

Post #1 of 4 (324 views)
Permalink
MultiViews on PHP files not working

Hi,


.php files are skipped when mod_negotiation looks for files.
Nailed it down to around the

while (apr_dir_read(&dirent, APR_FINFO_DIRENT, dirp) == APR_SUCCESS) {

loop in mod_negotation.c:read_types_multi().
Going to http://foo.bar/dead/ gives the following after adding printfs:
(/dead.php symlink to /dead2/index.php so that /dead does not exist, as per
MultiViews requirements)

Filename: dead2
Filename: dead.php
sub_req->handler=0x55555592ead8 sub_req->content_type=(nil)
exception_list=(nil)

and so it is 'obvious' why the .php files are skipped, because
exception_list == NULL and

exception_list =
(apr_array_header_t *)apr_table_get(sub_req->notes,
"ap-mime-exceptions-list");

fprintf(logfp, "exception_list=%p\n", exception_list);
if (!exception_list) {
ap_destroy_sub_req(sub_req);
continue;
}

triggered. But why is the content_type/exception_list NULL I wonder?
PHP files on their own work without a hitch.

Vhost conf:
<VirtualHost 1.3.3.7:80>
ServerName foo.bar
DocumentRoot /srv/www/foo.bar

DirectoryIndex index.php index.html index.htm
php_admin_flag safe_mode Off
ErrorLog /srv/www/foo.bar/log/error.log
AddHandler type-map .typemap

<Directory "/srv/www/foo.bar">
Options Indexes FollowSymlinks MultiViews
Order allow,deny
Allow from all
</Directory>

<Files ~ "^\.ht">
Order deny,allow
Deny from all
</Files>
<Location /svn>
Order allow,deny
Allow from all

DAV svn
SVNParentPath /srv/svn
SVNListParentPath on

AuthzSVNAccessFile /srv/svn/.htauthz
AuthzSVNNoAuthWhenAnonymousAllowed On

Satisfy Any
Require valid-user

AuthType Basic
AuthName "Authorization Realm"

<LimitExcept GET PROPFIND REPORT OPTIONS>
SSLRequireSSL
</LimitExcept>
</Location>
</VirtualHost>

---------------------------------------------------------------------
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 [at] httpd
" from the digest: users-digest-unsubscribe [at] httpd
For additional commands, e-mail: users-help [at] httpd


joshua at slive

Oct 28, 2007, 11:16 AM

Post #2 of 4 (295 views)
Permalink
Re: MultiViews on PHP files not working [In reply to]

On 10/27/07, Jan Engelhardt <jengelh [at] computergmbh> wrote:
> Hi,
>
>
> .php files are skipped when mod_negotiation looks for files.

This is just a guess, but perhaps you are using AddType rather than
AddHandler to activate php and need to read
http://mark.tranchant.co.uk/notes/multiviews

Joshua.

---------------------------------------------------------------------
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 [at] httpd
" from the digest: users-digest-unsubscribe [at] httpd
For additional commands, e-mail: users-help [at] httpd


jengelh at computergmbh

Oct 28, 2007, 11:23 AM

Post #3 of 4 (303 views)
Permalink
Re: MultiViews on PHP files not working [In reply to]

On Oct 28 2007 14:16, Joshua Slive wrote:
>On 10/27/07, Jan Engelhardt <jengelh [at] computergmbh> wrote:
>> Hi,
>>
>>
>> .php files are skipped when mod_negotiation looks for files.
>
>This is just a guess, but perhaps you are using AddType rather than
>AddHandler to activate php and need to read
>http://mark.tranchant.co.uk/notes/multiviews

grep -r php5 /etc/apache2:

./conf.d/php5.conf: AddHandler application/x-httpd-php .php

So it's in (this is the default config file from the distribution.)
The webpage you name says "AddHandler php-script .php",
does that make a difference?

---------------------------------------------------------------------
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 [at] httpd
" from the digest: users-digest-unsubscribe [at] httpd
For additional commands, e-mail: users-help [at] httpd


joshua at slive

Oct 28, 2007, 12:10 PM

Post #4 of 4 (299 views)
Permalink
Re: MultiViews on PHP files not working [In reply to]

On 10/28/07, Jan Engelhardt <jengelh [at] computergmbh> wrote:
>
> On Oct 28 2007 14:16, Joshua Slive wrote:
> >On 10/27/07, Jan Engelhardt <jengelh [at] computergmbh> wrote:
> >> Hi,
> >>
> >>
> >> .php files are skipped when mod_negotiation looks for files.
> >
> >This is just a guess, but perhaps you are using AddType rather than
> >AddHandler to activate php and need to read
> >http://mark.tranchant.co.uk/notes/multiviews
>
> grep -r php5 /etc/apache2:
>
> ./conf.d/php5.conf: AddHandler application/x-httpd-php .php
>
> So it's in (this is the default config file from the distribution.)
> The webpage you name says "AddHandler php-script .php",
> does that make a difference?

No, they should be synonymous.

---------------------------------------------------------------------
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 [at] httpd
" from the digest: users-digest-unsubscribe [at] httpd
For additional commands, e-mail: users-help [at] httpd

Apache users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.