Skip to content

Commit 8715271

Browse files
committed
- nginx: renamed PHP option "Fast-CGI" to "PHP-FPM".
1 parent 62e4b35 commit 8715271

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

interface/web/sites/templates/web_domain_edit.htm

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,13 +187,15 @@ <h2><tmpl_var name="list_head_txt"></h2>
187187
var selected = jQuery('#php').val();
188188
jQuery('.apache').hide();
189189
jQuery('.apache').hide();
190+
jQuery('#php option[value="fast-cgi"]').hide();
190191
jQuery('#php option[value="cgi"]').hide();
191192
jQuery('#php option[value="mod"]').hide();
192193
jQuery('#php option[value="suphp"]').hide();
193-
if(selected != "no" && selected != "fast-cgi") jQuery('#php option[value="fast-cgi"]').attr('selected', 'selected');
194+
if(selected != "no" && selected != "php-fpm") jQuery('#php option[value="php-fpm"]').attr('selected', 'selected');
194195
} else {
195196
jQuery('.apache').show();
196197
jQuery('.apache').show();
198+
jQuery('#php option[value="fast-cgi"]').show();
197199
jQuery('#php option[value="cgi"]').show();
198200
jQuery('#php option[value="mod"]').show();
199201
jQuery('#php option[value="suphp"]').show();

server/conf/nginx_vhost.conf.master

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ server {
105105
alias /usr/share/awstats/icon;
106106
}
107107

108-
<tmpl_if name='php' op='==' value='fast-cgi'>
108+
<tmpl_if name='php' op='==' value='php-fpm'>
109109
location ~ \.php$ {
110110
try_files $uri =404;
111111
include /etc/nginx/fastcgi_params;

server/plugins-available/nginx_plugin.inc.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -744,6 +744,9 @@ function update($event_name,$data) {
744744
$tpl->setVar('fpm_socket', $fpm_socket);
745745
$vhost_data['fpm_port'] = $web_config['php_fpm_start_port'] + $data['new']['domain_id'] - 1;
746746

747+
// 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.
748+
if($vhost_data['php'] == 'fast-cgi') $vhost_data['php'] = 'php-fpm';
749+
747750
// Custom nginx directives
748751
$final_nginx_directives = array();
749752
$nginx_directives = $data['new']['nginx_directives'];
@@ -1226,6 +1229,11 @@ function delete($event_name,$data) {
12261229
exec('rm -rf '.$fastcgi_starter_path);
12271230
}
12281231
}
1232+
1233+
// remove PHP-FPM pool
1234+
if ($data['old']['php'] == 'php-fpm') {
1235+
$this->php_fpm_pool_delete($data,$web_config);
1236+
}
12291237

12301238
//remove the php cgi starter script if available
12311239
if ($data['old']['php'] == 'cgi') {
@@ -1537,7 +1545,6 @@ private function awstats_delete ($data,$web_config) {
15371545
//* Update the PHP-FPM pool configuration file
15381546
private function php_fpm_pool_update ($data,$web_config,$pool_dir,$pool_name,$socket_dir) {
15391547
global $app, $conf;
1540-
//$reload = false;
15411548

15421549
if(trim($data['new']['fastcgi_php_version']) != ''){
15431550
$default_php_fpm = false;
@@ -1553,7 +1560,6 @@ private function php_fpm_pool_update ($data,$web_config,$pool_dir,$pool_name,$so
15531560
if($data['new']['php'] == 'no'){
15541561
if(@is_file($pool_dir.$pool_name.'.conf')){
15551562
unlink($pool_dir.$pool_name.'.conf');
1556-
//$reload = true;
15571563
}
15581564
if($data['old']['php'] != 'no'){
15591565
if(!$default_php_fpm){
@@ -1562,7 +1568,6 @@ private function php_fpm_pool_update ($data,$web_config,$pool_dir,$pool_name,$so
15621568
$app->services->restartService('php-fpm','reload:'.$conf['init_scripts'].'/'.$web_config['php_fpm_init_script']);
15631569
}
15641570
}
1565-
//if($reload == true) $app->services->restartService('php-fpm','reload');
15661571
return;
15671572
}
15681573

@@ -1673,10 +1678,6 @@ private function php_fpm_pool_update ($data,$web_config,$pool_dir,$pool_name,$so
16731678
} else {
16741679
$app->services->restartService('php-fpm','reload:'.$conf['init_scripts'].'/'.$web_config['php_fpm_init_script']);
16751680
}
1676-
1677-
//$reload = true;
1678-
1679-
//if($reload == true) $app->services->restartService('php-fpm','reload');
16801681
}
16811682

16821683
//* Delete the PHP-FPM pool configuration file

0 commit comments

Comments
 (0)