Skip to content

Commit 8c12a2f

Browse files
committed
Fix back PHP MultiViews in FCGID mode #1036
1 parent 9873fef commit 8c12a2f

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

functional-test.pl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,11 @@ package virtual_server;
564564
$test_domain_user.'/public_html/test.php',
565565
},
566566

567+
# Enable content negotiation for extensionless PHP requests
568+
{ 'command' => 'echo "Options +MultiViews" >~'.
569+
$test_domain_user.'/public_html/.htaccess',
570+
},
571+
567572
# Create a test sub-directory
568573
{ 'command' => 'su -s /bin/sh '.$test_domain_user.' -c "mkdir ~/public_html/foo"',
569574
},
@@ -665,6 +670,12 @@ package virtual_server;
665670
'cgi-fcgi' ],
666671
},
667672

673+
# Check PHP running via fCGId through MultiViews
674+
{ 'command' => $wget_command.'http://'.$test_domain.'/test',
675+
'grep' => [ 'uid=[0-9]+\\('.$test_domain_user.'\\)',
676+
'cgi-fcgi' ],
677+
},
678+
668679
# Set the PHP version for a sub-directory
669680
{ 'command' => 'set-php-directory.pl',
670681
'args' => [ [ 'domain' => $test_domain ],

php-lib.pl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,9 @@ sub save_domain_php_mode
412412
if ($mode eq "cgi") {
413413
push(@types, "application/x-httpd-php$ver .php");
414414
}
415-
elsif ($mode eq "mod_php") {
415+
# Keep a MIME type for MultiViews; execution is still selected by
416+
# the mode-specific handler or wrapper configured above.
417+
elsif ($mode eq "mod_php" || $mode eq "fcgid") {
416418
push(@types, "application/x-httpd-php .php");
417419
}
418420
@types = &unique(@types);

0 commit comments

Comments
 (0)