You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Jan Engelhardt <je...@computergmbh.de> on 2007/10/27 14:01:21 UTC

[users@httpd] 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@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] MultiViews on PHP files not working

Posted by Joshua Slive <jo...@slive.ca>.
On 10/28/07, Jan Engelhardt <je...@computergmbh.de> wrote:
>
> On Oct 28 2007 14:16, Joshua Slive wrote:
> >On 10/27/07, Jan Engelhardt <je...@computergmbh.de> 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@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] MultiViews on PHP files not working

Posted by Jan Engelhardt <je...@computergmbh.de>.
On Oct 28 2007 14:16, Joshua Slive wrote:
>On 10/27/07, Jan Engelhardt <je...@computergmbh.de> 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@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] MultiViews on PHP files not working

Posted by Joshua Slive <jo...@slive.ca>.
On 10/27/07, Jan Engelhardt <je...@computergmbh.de> 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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org