php-fpm - problem and question

JohnyByk

Verified User
Joined
Mar 7, 2012
Messages
248
Hi.

I have one problem with php-fpm.

Default template dosen't work.


Default configuration:
Code:
|*if HAVE_PHP1_FPM="1"|
        <IfModule mod_fastcgi.c>
                <FilesMatch "\.php$">
                        SetHandler php|PHP1_RELEASE|-fcgi
                </FilesMatch>
                FastCgiExternalServer |REALDOCROOT|/php|PHP1_RELEASE|-fpm -idle-timeout 300 -socket /usr/local/php|PHP1_RELEASE|/sockets/|USER|.sock -pass-header Authorization -user |USER| -group |GROUP|
                Alias /php|PHP1_RELEASE|-bin |REALDOCROOT|/php|PHP1_RELEASE|-fpm
        </IfModule>
|*endif|

My configuration:
Code:
|
*if HAVE_PHP1_FPM="1"|
        #ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://socket=%2fusr%2flocal%2fphp|PHP1_RELEASE|%2fsockets%2f|USER|.sock|DOCROOT|/$1 timeout=300
        RewriteRule ^/(.*\.php(/.*)?)$ fcgi://socket=\%2fusr\%2flocal\%2fphp|PHP1_RELEASE|\%2fsockets\%2f|USER|.sock|DOCROOT|/$1 [P,E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
|*endif|

Default configuration dosen't work for me (Internal Server Error).
My custom configuration work's OK. This configuration has been made long time ago and in fact, it was made for testing.

Do you have any problems with default configuration.

Is any possibility to use custom settings for php-fpm?
I think i saw "|CUSTOM_2|" tag in default template but now this variable is missing.

I want to set custom memory limits and max execution time for each user individually.

Regards
 
Check the error logs to see what the error is about.
 
I think so this is error related with looped redirects (.htacces). The problem does not affect all sites. Only sites based on cakePHP.
Code:
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

Problem affect suPHP and php-fpm (sites based on cakePHP framework).
With default DA template and mod_php the same sites work's OK.

Webroot o cakePHP:
/home/username/domains/domain.com/app/webroot

/home/username/domains/domain.com/.htaccess:
Code:
<IfModule mod_rewrite.c>
   RewriteEngine on
   RewriteRule    ^$ app/webroot/    [L]
   RewriteRule    (.*) app/webroot/$1 [L]
</IfModule>

/home/username/domains/domain.com/app/.htaccess:
Code:
<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule    ^$    webroot/    [L]
    RewriteRule    (.*) webroot/$1    [L]
</IfModule>

/home/username/domains/domain.com/app/webroot/.htaccess:
Code:
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>

Why sites work's with mod_php but dosen't work with suPHP ora php-fpm (with default template).

I would rather use the default template - it's newer and switch between PHP versions is possible from DA.

Maybe someone can help me improve new default template to work with cakePHP? I think so my custom template it's variation from 1.3.X of DA version.


Someone know how to set custom php-fpm.conf for users. After rewrite_confs changes disappearing :(
 
This shouldn't be a problem anymore with the latest versions of DA and CustomBuild. Thank you! :)
 
Back
Top