@@ -713,13 +713,32 @@ function update($event_name,$data) {
713713
714714 // PHP-FPM
715715 // Support for multiple PHP versions
716+ /*
716717 if(trim($data['new']['fastcgi_php_version']) != ''){
717718 $default_php_fpm = false;
718719 list($custom_php_fpm_name, $custom_php_fpm_init_script, $custom_php_fpm_ini_dir, $custom_php_fpm_pool_dir) = explode(':', trim($data['new']['fastcgi_php_version']));
719720 if(substr($custom_php_fpm_ini_dir,-1) != '/') $custom_php_fpm_ini_dir .= '/';
720721 } else {
721722 $default_php_fpm = true;
722723 }
724+ */
725+ if ($ data ['new ' ]['php ' ] != 'no ' ){
726+ if (trim ($ data ['new ' ]['fastcgi_php_version ' ]) != '' ){
727+ $ default_php_fpm = false ;
728+ list ($ custom_php_fpm_name , $ custom_php_fpm_init_script , $ custom_php_fpm_ini_dir , $ custom_php_fpm_pool_dir ) = explode (': ' , trim ($ data ['new ' ]['fastcgi_php_version ' ]));
729+ if (substr ($ custom_php_fpm_ini_dir ,-1 ) != '/ ' ) $ custom_php_fpm_ini_dir .= '/ ' ;
730+ } else {
731+ $ default_php_fpm = true ;
732+ }
733+ } else {
734+ if (trim ($ data ['old ' ]['fastcgi_php_version ' ]) != '' && $ data ['old ' ]['php ' ] != 'no ' ){
735+ $ default_php_fpm = false ;
736+ list ($ custom_php_fpm_name , $ custom_php_fpm_init_script , $ custom_php_fpm_ini_dir , $ custom_php_fpm_pool_dir ) = explode (': ' , trim ($ data ['old ' ]['fastcgi_php_version ' ]));
737+ if (substr ($ custom_php_fpm_ini_dir ,-1 ) != '/ ' ) $ custom_php_fpm_ini_dir .= '/ ' ;
738+ } else {
739+ $ default_php_fpm = true ;
740+ }
741+ }
723742
724743 if ($ default_php_fpm ){
725744 $ pool_dir = escapeshellcmd ($ web_config ['php_fpm_pool_dir ' ]);
@@ -1545,14 +1564,32 @@ private function awstats_delete ($data,$web_config) {
15451564 //* Update the PHP-FPM pool configuration file
15461565 private function php_fpm_pool_update ($ data ,$ web_config ,$ pool_dir ,$ pool_name ,$ socket_dir ) {
15471566 global $ app , $ conf ;
1548-
1567+ /*
15491568 if(trim($data['new']['fastcgi_php_version']) != ''){
15501569 $default_php_fpm = false;
15511570 list($custom_php_fpm_name, $custom_php_fpm_init_script, $custom_php_fpm_ini_dir, $custom_php_fpm_pool_dir) = explode(':', trim($data['new']['fastcgi_php_version']));
15521571 if(substr($custom_php_fpm_ini_dir,-1) != '/') $custom_php_fpm_ini_dir .= '/';
15531572 } else {
15541573 $default_php_fpm = true;
15551574 }
1575+ */
1576+ if ($ data ['new ' ]['php ' ] != 'no ' ){
1577+ if (trim ($ data ['new ' ]['fastcgi_php_version ' ]) != '' ){
1578+ $ default_php_fpm = false ;
1579+ list ($ custom_php_fpm_name , $ custom_php_fpm_init_script , $ custom_php_fpm_ini_dir , $ custom_php_fpm_pool_dir ) = explode (': ' , trim ($ data ['new ' ]['fastcgi_php_version ' ]));
1580+ if (substr ($ custom_php_fpm_ini_dir ,-1 ) != '/ ' ) $ custom_php_fpm_ini_dir .= '/ ' ;
1581+ } else {
1582+ $ default_php_fpm = true ;
1583+ }
1584+ } else {
1585+ if (trim ($ data ['old ' ]['fastcgi_php_version ' ]) != '' && $ data ['old ' ]['php ' ] != 'no ' ){
1586+ $ default_php_fpm = false ;
1587+ list ($ custom_php_fpm_name , $ custom_php_fpm_init_script , $ custom_php_fpm_ini_dir , $ custom_php_fpm_pool_dir ) = explode (': ' , trim ($ data ['old ' ]['fastcgi_php_version ' ]));
1588+ if (substr ($ custom_php_fpm_ini_dir ,-1 ) != '/ ' ) $ custom_php_fpm_ini_dir .= '/ ' ;
1589+ } else {
1590+ $ default_php_fpm = true ;
1591+ }
1592+ }
15561593
15571594 $ app ->uses ("getconf " );
15581595 $ web_config = $ app ->getconf ->get_server_config ($ conf ["server_id " ], 'web ' );
@@ -1684,7 +1721,7 @@ private function php_fpm_pool_update ($data,$web_config,$pool_dir,$pool_name,$so
16841721 private function php_fpm_pool_delete ($ data ,$ web_config ) {
16851722 global $ app , $ conf ;
16861723
1687- if (trim ($ data ['old ' ]['fastcgi_php_version ' ]) != '' ){
1724+ if (trim ($ data ['old ' ]['fastcgi_php_version ' ]) != '' && $ data [ ' old ' ][ ' php ' ] != ' no ' ){
16881725 $ default_php_fpm = false ;
16891726 list ($ custom_php_fpm_name , $ custom_php_fpm_init_script , $ custom_php_fpm_ini_dir , $ custom_php_fpm_pool_dir ) = explode (': ' , trim ($ data ['old ' ]['fastcgi_php_version ' ]));
16901727 if (substr ($ custom_php_fpm_ini_dir ,-1 ) != '/ ' ) $ custom_php_fpm_ini_dir .= '/ ' ;
@@ -1704,8 +1741,6 @@ private function php_fpm_pool_delete ($data,$web_config) {
17041741 if ( @is_file ($ pool_dir .$ pool_name .'.conf ' ) ) {
17051742 unlink ($ pool_dir .$ pool_name .'.conf ' );
17061743 $ app ->log ('Removed PHP-FPM config file: ' .$ pool_dir .$ pool_name .'.conf ' ,LOGLEVEL_DEBUG );
1707-
1708- //$app->services->restartService('php-fpm','reload');
17091744 }
17101745
17111746 // delete pool in all other PHP versions
0 commit comments