Skip to content

Commit 7fddfe8

Browse files
committed
- Implemented: FS#1079 - Custom php.ini files for fcgi and mod_php
- Fixed a formatting problem with suphp.conf and newer suphp versions.
1 parent a6904b0 commit 7fddfe8

File tree

12 files changed

+105
-8
lines changed

12 files changed

+105
-8
lines changed

install/lib/installer_base.lib.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -944,7 +944,7 @@ public function configure_apache() {
944944
exec('mkdir -p /var/log/ispconfig/httpd');
945945

946946
if(is_file('/etc/suphp/suphp.conf')) {
947-
replaceLine('/etc/suphp/suphp.conf','php=php:/usr/bin','x-httpd-suphp=php:/usr/bin/php-cgi',0);
947+
replaceLine('/etc/suphp/suphp.conf','php=php:/usr/bin','x-httpd-suphp="php:/usr/bin/php-cgi"',0);
948948
//replaceLine('/etc/suphp/suphp.conf','docroot=','docroot=/var/clients',0);
949949
replaceLine('/etc/suphp/suphp.conf','umask=0077','umask=0022',0);
950950
}

install/sql/ispconfig3.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,6 +1084,7 @@ CREATE TABLE `web_domain` (
10841084
`allow_override` varchar(255) NOT NULL default 'All',
10851085
`apache_directives` text,
10861086
`php_open_basedir` text,
1087+
`custom_php_ini` text,
10871088
`backup_interval` VARCHAR( 255 ) NOT NULL DEFAULT 'none',
10881089
`backup_copies` INT NOT NULL DEFAULT '1',
10891090
`active` enum('n','y') NOT NULL default 'y',

install/tpl/server.ini.master

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ awstats_conf_dir=/etc/awstats
5151
awstats_data_dir=/var/lib/awstats
5252
awstats_pl=/usr/lib/cgi-bin/awstats.pl
5353
awstats_buildstaticpages_pl=/usr/share/awstats/tools/awstats_buildstaticpages.pl
54+
php_ini_path_apache=/etc/php5/apache2/php.ini
55+
php_ini_path_cgi=/etc/php5/cgi/php.ini
5456

5557
[dns]
5658
bind_user=root

interface/web/admin/form/server_config.tform.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,28 @@
398398
'width' => '40',
399399
'maxlength' => '255'
400400
),
401+
'php_ini_path_apache' => array (
402+
'datatype' => 'VARCHAR',
403+
'formtype' => 'TEXT',
404+
'default' => '',
405+
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
406+
'errmsg'=> 'php_ini_path_apache_error_empty'),
407+
),
408+
'value' => '',
409+
'width' => '40',
410+
'maxlength' => '255'
411+
),
412+
'php_ini_path_cgi' => array (
413+
'datatype' => 'VARCHAR',
414+
'formtype' => 'TEXT',
415+
'default' => '',
416+
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
417+
'errmsg'=> 'php_ini_path_cgi_error_empty'),
418+
),
419+
'value' => '',
420+
'width' => '40',
421+
'maxlength' => '255'
422+
),
401423
'php_open_basedir' => array (
402424
'datatype' => 'VARCHAR',
403425
'formtype' => 'TEXT',

interface/web/admin/lib/lang/en_server_config.lng

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,7 @@ $wb["awstats_data_dir_txt"] = 'awstats data folder';
7070
$wb["awstats_pl_txt"] = 'awstats.pl script';
7171
$wb["awstats_buildstaticpages_pl_txt"] = 'awstats_buildstaticpages.pl script';
7272
$wb["backup_dir_txt"] = 'Backup directory';
73+
$wb["named_conf_local_path_txt"] = 'BIND named.conf.local path';
74+
$wb["php_ini_path_cgi_txt"] = 'CGI php.ini path';
75+
$wb["php_ini_path_apache_txt"] = 'Apache php.ini path';
7376
?>

interface/web/admin/templates/server_config_web_edit.htm

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,14 @@ <h2><tmpl_var name="list_head_txt"></h2>
4242
<input name="group" id="group" value="{tmpl_var name='group'}" size="40" maxlength="255" type="text" class="textInput" />
4343
</div>
4444
<div class="ctrlHolder">
45+
<label for="php_ini_path_apache">{tmpl_var name='php_ini_path_apache_txt'}</label>
46+
<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" />
47+
</div>
48+
<div class="ctrlHolder">
49+
<label for="php_ini_path_cgi">{tmpl_var name='php_ini_path_cgi_txt'}</label>
50+
<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" />
51+
</div>
52+
<div class="ctrlHolder">
4553
<label for="php_open_basedir">{tmpl_var name='php_open_basedir_txt'}</label>
4654
<input name="php_open_basedir" id="php_open_basedir" value="{tmpl_var name='php_open_basedir'}" size="40" maxlength="255" type="text" class="textInput" />
4755
</div>

interface/web/sites/form/web_domain.tform.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,14 @@
487487
'width' => '30',
488488
'maxlength' => '255'
489489
),
490+
'custom_php_ini' => array (
491+
'datatype' => 'TEXT',
492+
'formtype' => 'TEXT',
493+
'default' => '',
494+
'value' => '',
495+
'width' => '30',
496+
'maxlength' => '255'
497+
),
490498
'apache_directives' => array (
491499
'datatype' => 'TEXT',
492500
'formtype' => 'TEXT',

interface/web/sites/lib/lang/en_web_domain.lng

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ $wb["error_ssl_organisation_unit_empty"] = 'SSL Organisation Unit is empty.';
4949
$wb["error_ssl_country_empty"] = 'SSL Country is empty.';
5050
$wb["client_group_id_txt"] = 'Client';
5151
$wb["stats_password_txt"] = 'Webstatistics password';
52-
$wb["allow_override_txt"] = 'Allow Override';
52+
$wb["allow_override_txt"] = 'Apache AllowOverride';
5353
$wb["limit_web_quota_free_txt"] = 'Max. available Harddisk Quota';
5454
$wb["ssl_state_error_regex"] = 'Invalid SSL State. Valid characters are: a-z, 0-9 and .,-_';
5555
$wb["ssl_locality_error_regex"] = 'Invalid SSL Locality. Valid characters are: a-z, 0-9 and .,-_';
@@ -63,4 +63,5 @@ $wb["traffic_quota_exceeded_txt"] = 'Traffic quota exceeded';
6363
$wb["ruby_txt"] = 'Ruby';
6464
$wb["stats_user_txt"] = 'Webstatistics username';
6565
$wb["stats_type_txt"] = 'Webstatistics program';
66+
$wb["custom_php_ini_txt"] = 'Custom php.ini settings';
6667
?>

interface/web/sites/templates/web_domain_advanced.htm

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,16 @@ <h2><tmpl_var name="list_head_txt"></h2>
2222
</div>
2323
<div class="ctrlHolder">
2424
<label for="php_open_basedir">{tmpl_var name='php_open_basedir_txt'}</label>
25-
<input name="php_open_basedir" id="php_open_basedir" value="{tmpl_var name='php_open_basedir'}" size="30" maxlength="255" type="text" class="textInput" />
25+
<input name="php_open_basedir" id="php_open_basedir" value="{tmpl_var name='php_open_basedir'}" size="30" maxlength="255" type="text" class="textInput" style="width:400px;" />
26+
</div>
27+
<div class="ctrlHolder">
28+
<label for="custom_php_ini">{tmpl_var name='custom_php_ini_txt'}</label>
29+
<textarea name="custom_php_ini" id="custom_php_ini" rows='10' cols='50' style="width:400px;">{tmpl_var name='custom_php_ini'}</textarea>
2630
</div>
2731
<div class="ctrlHolder">
2832
<label for="apache_directives">{tmpl_var name='apache_directives_txt'}</label>
29-
<textarea name="apache_directives" id="apache_directives" rows='10' cols='30'>{tmpl_var name='apache_directives'}</textarea>
30-
</div>
33+
<textarea name="apache_directives" id="apache_directives" rows='10' cols='50' style="width:400px;">{tmpl_var name='apache_directives'}</textarea>
34+
</div>
3135
</fieldset>
3236

3337
<input type="hidden" name="id" value="{tmpl_var name='id'}">

server/conf/php-cgi-starter.master

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#!/bin/sh
22

3+
<tmpl_if name='has_custom_php_ini'>
4+
export PHPRC="<tmpl_var name='php_ini_path'>"
5+
</tmpl_if>
6+
37
exec <tmpl_var name='php_cgi_bin'> \
48
-d open_basedir=<tmpl_var name='open_basedir'> \
59
-d upload_tmp_dir=<tmpl_var name='document_root'>/tmp \

0 commit comments

Comments
 (0)