Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
ISPConfig 3
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Zvonimir
ISPConfig 3
Commits
4d69f4fa
Commit
4d69f4fa
authored
Apr 20, 2012
by
Falko Timme
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Bugfix: nginx: delete non-default PHP-FPM pool if PHP is disabled for website.
parent
87152714
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
4 deletions
+39
-4
server/plugins-available/nginx_plugin.inc.php
server/plugins-available/nginx_plugin.inc.php
+39
-4
No files found.
server/plugins-available/nginx_plugin.inc.php
View file @
4d69f4fa
...
...
@@ -713,6 +713,7 @@ class nginx_plugin {
// PHP-FPM
// Support for multiple PHP versions
/*
if(trim($data['new']['fastcgi_php_version']) != ''){
$default_php_fpm = false;
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']));
...
...
@@ -720,6 +721,24 @@ class nginx_plugin {
} else {
$default_php_fpm = true;
}
*/
if
(
$data
[
'new'
][
'php'
]
!=
'no'
){
if
(
trim
(
$data
[
'new'
][
'fastcgi_php_version'
])
!=
''
){
$default_php_fpm
=
false
;
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'
]));
if
(
substr
(
$custom_php_fpm_ini_dir
,
-
1
)
!=
'/'
)
$custom_php_fpm_ini_dir
.
=
'/'
;
}
else
{
$default_php_fpm
=
true
;
}
}
else
{
if
(
trim
(
$data
[
'old'
][
'fastcgi_php_version'
])
!=
''
&&
$data
[
'old'
][
'php'
]
!=
'no'
){
$default_php_fpm
=
false
;
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'
]));
if
(
substr
(
$custom_php_fpm_ini_dir
,
-
1
)
!=
'/'
)
$custom_php_fpm_ini_dir
.
=
'/'
;
}
else
{
$default_php_fpm
=
true
;
}
}
if
(
$default_php_fpm
){
$pool_dir
=
escapeshellcmd
(
$web_config
[
'php_fpm_pool_dir'
]);
...
...
@@ -1545,7 +1564,7 @@ class nginx_plugin {
//* 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
;
/*
if(trim($data['new']['fastcgi_php_version']) != ''){
$default_php_fpm = false;
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']));
...
...
@@ -1553,6 +1572,24 @@ class nginx_plugin {
} else {
$default_php_fpm = true;
}
*/
if
(
$data
[
'new'
][
'php'
]
!=
'no'
){
if
(
trim
(
$data
[
'new'
][
'fastcgi_php_version'
])
!=
''
){
$default_php_fpm
=
false
;
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'
]));
if
(
substr
(
$custom_php_fpm_ini_dir
,
-
1
)
!=
'/'
)
$custom_php_fpm_ini_dir
.
=
'/'
;
}
else
{
$default_php_fpm
=
true
;
}
}
else
{
if
(
trim
(
$data
[
'old'
][
'fastcgi_php_version'
])
!=
''
&&
$data
[
'old'
][
'php'
]
!=
'no'
){
$default_php_fpm
=
false
;
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'
]));
if
(
substr
(
$custom_php_fpm_ini_dir
,
-
1
)
!=
'/'
)
$custom_php_fpm_ini_dir
.
=
'/'
;
}
else
{
$default_php_fpm
=
true
;
}
}
$app
->
uses
(
"getconf"
);
$web_config
=
$app
->
getconf
->
get_server_config
(
$conf
[
"server_id"
],
'web'
);
...
...
@@ -1684,7 +1721,7 @@ class nginx_plugin {
private
function
php_fpm_pool_delete
(
$data
,
$web_config
)
{
global
$app
,
$conf
;
if
(
trim
(
$data
[
'old'
][
'fastcgi_php_version'
])
!=
''
){
if
(
trim
(
$data
[
'old'
][
'fastcgi_php_version'
])
!=
''
&&
$data
[
'old'
][
'php'
]
!=
'no'
){
$default_php_fpm
=
false
;
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'
]));
if
(
substr
(
$custom_php_fpm_ini_dir
,
-
1
)
!=
'/'
)
$custom_php_fpm_ini_dir
.
=
'/'
;
...
...
@@ -1704,8 +1741,6 @@ class nginx_plugin {
if
(
@
is_file
(
$pool_dir
.
$pool_name
.
'.conf'
)
)
{
unlink
(
$pool_dir
.
$pool_name
.
'.conf'
);
$app
->
log
(
'Removed PHP-FPM config file: '
.
$pool_dir
.
$pool_name
.
'.conf'
,
LOGLEVEL_DEBUG
);
//$app->services->restartService('php-fpm','reload');
}
// delete pool in all other PHP versions
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment