ftimme
2012-04-20 871527144083db0e06d94c903fab172d0227a2f8
- nginx: renamed PHP option "Fast-CGI" to "PHP-FPM".
3 files modified
21 ■■■■■ changed files
interface/web/sites/templates/web_domain_edit.htm 4 ●●● patch | view | raw | blame | history
server/conf/nginx_vhost.conf.master 2 ●●● patch | view | raw | blame | history
server/plugins-available/nginx_plugin.inc.php 15 ●●●● patch | view | raw | blame | history
interface/web/sites/templates/web_domain_edit.htm
@@ -187,13 +187,15 @@
                    var selected = jQuery('#php').val();
                    jQuery('.apache').hide();
                    jQuery('.apache').hide();
                    jQuery('#php option[value="fast-cgi"]').hide();
                    jQuery('#php option[value="cgi"]').hide();
                    jQuery('#php option[value="mod"]').hide();
                    jQuery('#php option[value="suphp"]').hide();
                    if(selected != "no" && selected != "fast-cgi") jQuery('#php option[value="fast-cgi"]').attr('selected', 'selected');
                    if(selected != "no" && selected != "php-fpm") jQuery('#php option[value="php-fpm"]').attr('selected', 'selected');
                } else {
                    jQuery('.apache').show();
                    jQuery('.apache').show();
                    jQuery('#php option[value="fast-cgi"]').show();
                    jQuery('#php option[value="cgi"]').show();
                    jQuery('#php option[value="mod"]').show();
                    jQuery('#php option[value="suphp"]').show();
server/conf/nginx_vhost.conf.master
@@ -105,7 +105,7 @@
            alias /usr/share/awstats/icon;
        }
<tmpl_if name='php' op='==' value='fast-cgi'>
<tmpl_if name='php' op='==' value='php-fpm'>
        location ~ \.php$ {
            try_files $uri =404;
            include /etc/nginx/fastcgi_params;
server/plugins-available/nginx_plugin.inc.php
@@ -744,6 +744,9 @@
        $tpl->setVar('fpm_socket', $fpm_socket);
        $vhost_data['fpm_port'] = $web_config['php_fpm_start_port'] + $data['new']['domain_id'] - 1;
        
        // backwards compatibility; since ISPConfig 3.0.5, the PHP mode for nginx is called 'php-fpm' instead of 'fast-cgi'. The following line makes sure that old web sites that have 'fast-cgi' in the database still get PHP-FPM support.
        if($vhost_data['php'] == 'fast-cgi') $vhost_data['php'] = 'php-fpm';
        // Custom nginx directives
        $final_nginx_directives = array();
        $nginx_directives = $data['new']['nginx_directives'];
@@ -1226,6 +1229,11 @@
                    exec('rm -rf '.$fastcgi_starter_path);
                }
            }
            // remove PHP-FPM pool
            if ($data['old']['php'] == 'php-fpm') {
                $this->php_fpm_pool_delete($data,$web_config);
            }
            //remove the php cgi starter script if available
            if ($data['old']['php'] == 'cgi') {
@@ -1537,7 +1545,6 @@
    //* Update the PHP-FPM pool configuration file
    private function php_fpm_pool_update ($data,$web_config,$pool_dir,$pool_name,$socket_dir) {
        global $app, $conf;
        //$reload = false;
        
        if(trim($data['new']['fastcgi_php_version']) != ''){
            $default_php_fpm = false;
@@ -1553,7 +1560,6 @@
        if($data['new']['php'] == 'no'){
            if(@is_file($pool_dir.$pool_name.'.conf')){
                unlink($pool_dir.$pool_name.'.conf');
                //$reload = true;
            }
            if($data['old']['php'] != 'no'){
                if(!$default_php_fpm){
@@ -1562,7 +1568,6 @@
                    $app->services->restartService('php-fpm','reload:'.$conf['init_scripts'].'/'.$web_config['php_fpm_init_script']);
                }
            }
            //if($reload == true) $app->services->restartService('php-fpm','reload');
            return;
        }
                
@@ -1673,10 +1678,6 @@
        } else {
            $app->services->restartService('php-fpm','reload:'.$conf['init_scripts'].'/'.$web_config['php_fpm_init_script']);
        }
        //$reload = true;
        //if($reload == true) $app->services->restartService('php-fpm','reload');
    }
    
    //* Delete the PHP-FPM pool configuration file