Topic: Difference between mod_php and php-fpm with double extension in URI

Note: in this post i've replaced "www" by "w ww" because "Too more links in message. Allowed 1 links. Reduce number of links and post it again."


Hello,

With a SimpleSAMLphp project, the are URI like :

/slug/module.php/idP/loginuserpass.php?...

In .htaccess :

RewriteRule ^([a-z0-9-]+)/(.*)$ /simplesaml/$2 [QSA,E=SLUG:$1]

After rewrite :

/simplesamlphp/module.php/idP/loginuserpass.php?...

In source files, "tree" of document root :

web/
├── ...
├── .htaccess
└── simplesaml -> ../vendor/simplesamlphp/simplesamlphp/w ww
├── ...

In source files, "tree" of symlink :

vendor/simplesamlphp/simplesamlphp/w ww/
├── ...
├── module.php
├── ...

With mod_php = no problem.

> Executed script file is : vendor/simplesamlphp/simplesamlphp/w ww/module.php

> Argument is : /idP/loginuserpass.php?...

With php-fpm = problem.

"File not found." is displayed.

<FilesMatch ".+\.php(.+)?$">
    SetHandler "proxy:unix:/run/php/php5.6-fpm.sock|fcgi://localhost"
</FilesMatch>

> Executed script seems to be : vendor/simplesamlphp/simplesamlphp/w ww/module.php/idP/loginuserpass.php?...

> No argument

Help :
- any ideas to resolve this problem ?
- how to configure PHP-FPM in this case ?

Thanks

Re: Difference between mod_php and php-fpm with double extension in URI

Try, simply

     <FilesMatch \.php$>
Desktop: Fedora 25 x86_64 + rpmfusion + remi-test + remi-dev
Laptop:  Fedora 24 x86_64 + remi (SCL only)
Hosting Server: CentOS 6.8 x86_64 + EPEL + remi + remi-php70

Re: Difference between mod_php and php-fpm with double extension in URI

Hello Remi,

Same error "File not found".

PHP-FPM works fine, it's just this case with rewrite and double php extension.

Re: Difference between mod_php and php-fpm with double extension in URI

Double suffix is not an issue with FPM, works for me
=> http://localhost/module.php/index.php?foo=bar
=> http://php70scl//module.php/index.php/login.php

Sorry, don't see anything obviously wrong...

Desktop: Fedora 25 x86_64 + rpmfusion + remi-test + remi-dev
Laptop:  Fedora 24 x86_64 + remi (SCL only)
Hosting Server: CentOS 6.8 x86_64 + EPEL + remi + remi-php70

Re: Difference between mod_php and php-fpm with double extension in URI

Which Apache version are you using ? (from which provider, distro, version, arch)
IIRC there is redirect issue with 2.4.25
(BTW official RH packages in RHEL-7 or RHSCL 2.4 works as expected)

Desktop: Fedora 25 x86_64 + rpmfusion + remi-test + remi-dev
Laptop:  Fedora 24 x86_64 + remi (SCL only)
Hosting Server: CentOS 6.8 x86_64 + EPEL + remi + remi-php70

Re: Difference between mod_php and php-fpm with double extension in URI

I've Apache Apache/2.4.25 (Ubuntu).

Is this a rewriting problem or symbolic link problem with /web/simplesaml ?

I do not have an explanation either...

Re: Difference between mod_php and php-fpm with double extension in URI

> Ubuntu

Sorry, but this forum if for Users of my repository (Fedora, RHEL or CentOS)

Definitively can't help

Desktop: Fedora 25 x86_64 + rpmfusion + remi-test + remi-dev
Laptop:  Fedora 24 x86_64 + remi (SCL only)
Hosting Server: CentOS 6.8 x86_64 + EPEL + remi + remi-php70

Re: Difference between mod_php and php-fpm with double extension in URI

BTW, for memory, fixed in apache 2.4.26

Desktop: Fedora 25 x86_64 + rpmfusion + remi-test + remi-dev
Laptop:  Fedora 24 x86_64 + remi (SCL only)
Hosting Server: CentOS 6.8 x86_64 + EPEL + remi + remi-php70