Skip to content

Commit 62b385f

Browse files
committed
- Added support for multiple PHP versions (Apache + PHP-FastCGI).
1 parent 0732d32 commit 62b385f

File tree

14 files changed

+168
-3
lines changed

14 files changed

+168
-3
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ALTER TABLE `web_domain` ADD `fastcgi_php_version` VARCHAR( 255 ) NULL DEFAULT NULL;

install/sql/ispconfig3.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1549,6 +1549,7 @@ CREATE TABLE `web_domain` (
15491549
`backup_copies` INT NOT NULL DEFAULT '1',
15501550
`active` enum('n','y') NOT NULL default 'y',
15511551
`traffic_quota_lock` enum('n','y') NOT NULL default 'n',
1552+
`fastcgi_php_version` varchar(255) DEFAULT NULL,
15521553
PRIMARY KEY (`domain_id`)
15531554
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
15541555

install/tpl/server.ini.master

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ fastcgi_children=8
9090
fastcgi_max_requests=5000
9191
fastcgi_bin=/usr/bin/php-cgi
9292
fastcgi_config_syntax=1
93+
fastcgi_additional_php_versions=
9394

9495
[jailkit]
9596
jailkit_chroot_home=/home/[username]

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -867,6 +867,14 @@
867867
'width' => '40',
868868
'maxlength' => '255'
869869
),
870+
'fastcgi_additional_php_versions' => array (
871+
'datatype' => 'VARCHAR',
872+
'formtype' => 'TEXT',
873+
'default' => '',
874+
'value' => '',
875+
'width' => '30',
876+
'maxlength' => '255'
877+
),
870878
##################################
871879
# ENDE Datatable fields
872880
##################################

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,4 +153,6 @@ $wb['set_folder_permissions_on_update_txt'] = 'Set folder permissions on update'
153153
$wb['add_web_users_to_sshusers_group_txt'] = 'Add web users to -sshusers- group';
154154
$wb['connect_userid_to_webid_txt'] = 'Connect Linux userid to webid';
155155
$wb['connect_userid_to_webid_start_txt'] = 'Start ID for userid/webid connect';
156+
$wb["fastcgi_additional_php_versions_txt"] = 'Zusätzliche PHP-Versionen';
157+
$wb["fastcgi_additional_php_versions_hint_txt"] = 'Format:<br>&lt;name&gt;;&lt;path_to_executable&gt;;&lt;path_to_php.ini_dir&gt;<br>z.B.:<br>PHP 5.2.17;/opt/php52/bin/php-cgi;/opt/php52/etc/';
156158
?>

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,4 +157,6 @@ $wb["connect_userid_to_webid_txt"] = 'Connect Linux userid to webid';
157157
$wb["connect_userid_to_webid_start_txt"] = 'Start ID for userid/webid connect';
158158
$wb["realtime_blackhole_list_txt"] = 'Real-time Blackhole List';
159159
$wb["realtime_blackhole_list_note_txt"] = '(Separate RBL\'s with commas)';
160+
$wb["fastcgi_additional_php_versions_txt"] = 'Additional PHP Versions';
161+
$wb["fastcgi_additional_php_versions_hint_txt"] = 'Format:<br>&lt;name&gt;;&lt;path_to_executable&gt;;&lt;path_to_php.ini_dir&gt;<br>e.g.:<br>PHP 5.2.17;/opt/php52/bin/php-cgi;/opt/php52/etc/';
160162
?>

interface/web/admin/templates/server_config_fastcgi_edit.htm

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ <h2><tmpl_var name="list_head_txt"></h2>
3939
{tmpl_var name='fastcgi_config_syntax'}
4040
</select>
4141
</div>
42+
<div class="ctrlHolder">
43+
<label for="fastcgi_additional_php_versions">{tmpl_var name='fastcgi_additional_php_versions_txt'}</label>
44+
<textarea rows="10" cols="40" name="fastcgi_additional_php_versions" id="fastcgi_additional_php_versions" type="text" class="textInput">{tmpl_var name='fastcgi_additional_php_versions'}</textarea> {tmpl_var name='fastcgi_additional_php_versions_hint_txt'}
45+
</div>
4246
</fieldset>
4347

4448
<input type="hidden" name="id" value="{tmpl_var name='id'}">
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<?php
2+
3+
/*
4+
Copyright (c) 2005, Till Brehm, projektfarm Gmbh
5+
All rights reserved.
6+
7+
Redistribution and use in source and binary forms, with or without modification,
8+
are permitted provided that the following conditions are met:
9+
10+
* Redistributions of source code must retain the above copyright notice,
11+
this list of conditions and the following disclaimer.
12+
* Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
* Neither the name of ISPConfig nor the names of its contributors
16+
may be used to endorse or promote products derived from this software without
17+
specific prior written permission.
18+
19+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
20+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22+
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
23+
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
24+
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
26+
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
28+
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29+
*/
30+
31+
require_once('../../lib/config.inc.php');
32+
require_once('../../lib/app.inc.php');
33+
34+
//* Check permissions for module
35+
$app->auth->check_module_permissions('sites');
36+
37+
$server_id = intval($_GET["server_id"]);
38+
$client_group_id = intval($_GET["client_group_id"]);
39+
40+
if($_SESSION["s"]["user"]["typ"] == 'admin' or $app->auth->has_clients($_SESSION['s']['user']['userid'])) {
41+
42+
$app->uses('ini_parser,getconf');
43+
$fastcgi = $app->getconf->get_server_config($server_id,'fastcgi');
44+
$php_versions = explode('\n',$fastcgi['fastcgi_additional_php_versions']);
45+
46+
$php_select = "";
47+
48+
if(is_array($php_versions)) {
49+
foreach( $php_versions as $php_version) {
50+
$php_select .= "#$php_version";
51+
}
52+
}
53+
54+
unset($php_versions);
55+
}
56+
57+
echo $php_select;
58+
?>

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,17 @@
210210
'valuelimit' => 'client:web_php_options',
211211
'value' => array('no' => 'disabled_txt', 'fast-cgi' => 'Fast-CGI', 'cgi' => 'CGI', 'mod' => 'Mod-PHP', 'suphp' => 'SuPHP')
212212
),
213+
'fastcgi_php_version' => array (
214+
'datatype' => 'VARCHAR',
215+
'formtype' => 'SELECT',
216+
'default' => '',
217+
/*'datasource' => array ( 'type' => 'SQL',
218+
'querystring' => "SELECT ip_address,ip_address FROM server_ip WHERE ip_type = 'IPv4' AND {AUTHSQL} ORDER BY ip_address",
219+
'keyfield'=> 'ip_address',
220+
'valuefield'=> 'ip_address'
221+
),*/
222+
'value' => ''
223+
),
213224
'ruby' => array (
214225
'datatype' => 'VARCHAR',
215226
'formtype' => 'CHECKBOX',

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,4 +89,5 @@ $wb['pm_max_children_error_regex'] = 'PHP-FPM pm.max_children mu&szlig; eine pos
8989
$wb['pm_start_servers_error_regex'] = 'PHP-FPM pm.start_servers mu&szlig; eine positive ganze Zahl sein.';
9090
$wb['pm_min_spare_servers_error_regex'] = 'PHP-FPM pm.min_spare_servers mu&szlig; eine positive ganze Zahl sein.';
9191
$wb['pm_max_spare_servers_error_regex'] = 'PHP-FPM pm.max_spare_servers mu&szlig; eine positive ganze Zahl sein.';
92+
$wb["fastcgi_php_version_txt"] = 'FastCGI-PHP-Version';
9293
?>

0 commit comments

Comments
 (0)