Problem with use PHP-FPM for sub and domains when suphp is default

Magician

Verified User
Joined
Jan 31, 2010
Messages
135
Location
EU / PL
According CB2.0 FAQ I finally upgrade system. My options.conf for PHP
Code:
php1_release=5.3
php2_release=5.4
php1_mode=suphp
php2_mode=php-fpm

When I try add to one site .htaccess:
Code:
<FilesMatch \.php$>
    SetHandler php54-fcgi
</FilesMatch>

I get

Code:
Forbidden

You don't have permission to access /fastcgiphp54maxp/index.php on this server.

Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.

where maxp is user account name.

When I set
Code:
<FilesMatch \.php$>
    SetHandler php54-fcgi
</FilesMatch>
to site which have custom httpd.conf, like
Code:
|?DOCROOT=/home/gldd/domains/something.com/public_html/web|
then works fine.

Any suggestion what I need change to handler type for some pages, without define docroot everytime?

------------------------------------------------
I found in per user vhost definition wrong code:
Code:
<IfModule mod_fastcgi.c>
        FastCgiExternalServer /home/gldd/public_html/index.php54 -socket /usr/local/php54/sockets/gldd.sock -pass-header Authorization
        Alias /fastcgiphp54tuning /home/gldd/public_html/index.php54
        <Location "/fastcgiphp54gldd">
                Order Deny,Allow
                Deny from All
                Allow from env=REDIRECT_STATUS
        </Location>
</IfModule>
index.php54 should be index.php
 
Last edited:
This is my options.conf
Code:
php1_release=5.3
php2_release=5.4
php1_mode=suphp
php2_mode=php-fpm

But my problem with the mod_rewrite :
i got

HTML:
[Mon Nov 19 18:27:11.204460 2012] [core:error] [pid 28803:tid 1311533376] [client 209.190.35.252:3612] AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use LimitInternalRecursion' to increase
the limit if necessary. Use 'LogLevel debug' to get a backtrace.

httaccess setting :
HTML:
http://book.cakephp.org/2.0/en/installation/advanced-installation.html#apache-and-mod-rewrite-and-htaccess

please help me
(sorry can not good write english :( )
 
I wrote you a PM about a month ago about this issue, however, I got no reply from you.
 
Hello,

I've just tested this setup (suphp53 + php-fpm54) on our FreeBSD 8 64-bit box... but it all seemed to work ok for me.

Note that mod_ruid2 is not on (mod_ruid2 doesn't support FreeBSD)

You may also want to check the other thread about the recent changes (very recent, as in last 10 minutes) on the php-fpm.conf templates... although, they wouldn't affect my test, since I'm not using mod_ruid2.

John
 
It's not allowed to install php-fpm with mod_ruid2 so mod_ruid2 is not on. Like I wrote before seems the auto generated httpd conf files have errors. I change it manually but after every rewrote httpd config I must repeat it again.
 
You don't have permission to access /fastcgiphp54maxp/index.php on this server.
since I'm not getting the same error, then my guess is that your configs may be different somewhere..

I know it was changed a short while ago, but check:
/usr/local/directadmin/data/users/username/php/php-fpm54.conf

We're looking for this:
Code:
security.limit_extensions = .php .php54 .php5
my guess is yours doesn't have .php54 in the list, hence the error.
Ensure you're running the latest version of DA, and that your template file:
/usr/local/directadmin/data/templates/php-fpm.conf

is up to date.
Also check for a custom version, which would override ours:
/usr/local/directadmin/data/templates/custom/php-fpm.conf

Then issue a:
Code:
./build rewrite_confs
John
 
I'm digging more and in /usr/local/directadmin/data/templates/virtual_host2.conf
Code:
|*if HAVE_PHP2_FPM="1"|
<FilesMatch \.php|PHP2_RELEASE|$>
    SetHandler php|PHP2_RELEASE|-fcgi
</FilesMatch>
<Location "/fastcgiphp|PHP2_RELEASE|">
    Order Deny,Allow
    Deny from All
    Allow from env=REDIRECT_STATUS
</Location>
Action php|PHP2_RELEASE|-fcgi /fastcgiphp|PHP2_RELEASE|
    FastCgiExternalServer |REALDOCROOT|/index.php|PHP2_RELEASE| -socket /usr/local/php|PHP2_RELEASE|/sockets/|USER|.sock -pass-header Authorization
    Alias /fastcgiphp|PHP2_RELEASE| |DOCROOT|/index.php|PHP2_RELEASE|
|*endif|
/index.php|PHP2_RELEASE| give index.php54 which doesn't exist. What reason is to use index.php54 ?
 
Maybe, but until I manually change index.php54 to index.php this doesn't work. (yes, I check security.limit_extensions = .php .php54 .php5, I have this line in my config).

BTW - What reason is behind generate index.php54 only in PHP2_FPM mode?

Code:
|*if HAVE_PHP1_FPM="1"|
    <FilesMatch \.php$>
        SetHandler php|PHP1_RELEASE|-fcgi
    </FilesMatch>
    <Location "/fastcgiphp">
        Order Deny,Allow
        Deny from All
        Allow from env=REDIRECT_STATUS
    </Location>
    Action php|PHP1_RELEASE|-fcgi /fastcgiphp
    FastCgiExternalServer |REALDOCROOT|/[B]index.php[/B] -socket /usr/local/php|PHP1_RELEASE|/sockets/|USER|.sock -pass-header Authorization
    Alias /fastcgiphp |DOCROOT|/[B]index.php[/B]
|*endif|
|*if HAVE_PHP2_FPM="1"|
    <FilesMatch \.php|PHP2_RELEASE|$>
        SetHandler php|PHP2_RELEASE|-fcgi
    </FilesMatch>
    <Location "/fastcgiphp|PHP2_RELEASE|">
        Order Deny,Allow
        Deny from All
        Allow from env=REDIRECT_STATUS
    </Location>
    Action php|PHP2_RELEASE|-fcgi /fastcgiphp|PHP2_RELEASE|
    FastCgiExternalServer |REALDOCROOT|/[B]index.php|PHP2_RELEASE|[/B] -socket /usr/local/php|PHP2_RELEASE|/sockets/|USER|.sock -pass-header Authorization
    Alias /fastcgiphp|PHP2_RELEASE| |DOCROOT|/[B]index.php|PHP2_RELEASE|[/B]
|*endif|
 
Last edited:
The reason is simple. You cannot have 2 FastCgiExternalServers with the same filename specified. That would not allow you to run 2 different PHP versions as PHP-FPM. Please check: http://www.fastcgi.com/mod_fastcgi/docs/mod_fastcgi.html#FastCgiExternalServer. It clearly states that filename does not need to exist. I was not able to reproduce the problem you specify too, nor got the details in PM.
 
Back
Top