Commit add36e9a authored by Falko Timme's avatar Falko Timme

- Added open_basedir support to PHP-FPM.

parent 4ffb51e5
......@@ -89,7 +89,7 @@
<label for="php_ini_path_apache">{tmpl_var name='php_ini_path_apache_txt'}</label>
<input name="php_ini_path_apache" id="php_ini_path_apache" value="{tmpl_var name='php_ini_path_apache'}" size="40" maxlength="255" type="text" class="textInput" />
</div>
<div class="ctrlHolder">
<div class="ctrlHolder apache">
<label for="php_ini_path_cgi">{tmpl_var name='php_ini_path_cgi_txt'}</label>
<input name="php_ini_path_cgi" id="php_ini_path_cgi" value="{tmpl_var name='php_ini_path_cgi'}" size="40" maxlength="255" type="text" class="textInput" />
</div>
......
......@@ -11,4 +11,6 @@ pm.start_servers = 20
pm.min_spare_servers = 5
pm.max_spare_servers = 35
chdir = /
\ No newline at end of file
chdir = /
<tmpl_var name='enable_php_open_basedir'>php_admin_value[open_basedir] = <tmpl_var name='php_open_basedir'>
\ No newline at end of file
......@@ -640,7 +640,6 @@ class nginx_plugin {
$vhost_data['web_basedir'] = $web_config['website_basedir'];
$vhost_data['security_level'] = $web_config['security_level'];
$vhost_data['allow_override'] = ($data['new']['allow_override'] == '')?'All':$data['new']['allow_override'];
//$vhost_data['php_open_basedir'] = ($data['new']['php_open_basedir'] == '')?$data['new']['document_root']:$data['new']['php_open_basedir'];
$vhost_data['ssl_domain'] = $data['new']['ssl_domain'];
//$vhost_data['has_custom_php_ini'] = $has_custom_php_ini;
//$vhost_data['custom_php_ini_dir'] = escapeshellcmd($custom_php_ini_dir);
......@@ -1082,6 +1081,13 @@ class nginx_plugin {
$tpl->setVar('fpm_port', $web_config['php_fpm_start_port'] + $data['new']['domain_id']);
$tpl->setVar('fpm_user', $data['new']['system_user']);
$tpl->setVar('fpm_group', $data['new']['system_group']);
$php_open_basedir = ($data['new']['php_open_basedir'] == '')?$data['new']['document_root']:$data['new']['php_open_basedir'];
$tpl->setVar('php_open_basedir', $php_open_basedir);
if($php_open_basedir != ''){
$tpl->setVar('enable_php_open_basedir', '');
} else {
$tpl->setVar('enable_php_open_basedir', ';');
}
file_put_contents($pool_dir.'/'.$data['new']['domain'].'.conf',$tpl->grab());
$app->log('Writing the PHP-FPM config file: '.$pool_dir.'/'.$data['new']['domain'].'.conf',LOGLEVEL_DEBUG);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment