@@ -36,27 +36,61 @@ public function install()
36
36
$ commands [] = 'add-apt-repository -y ppa:ondrej/php ' ;
37
37
$ commands [] = 'add-apt-repository -y ppa:ondrej/apache2 ' ;
38
38
39
- $ dependenciesList = [
39
+
40
+ $ apacheCommands = [];
41
+ $ apacheCommands [] = 'a2enmod cgi ' ;
42
+ $ apacheCommands [] = 'a2enmod deflate ' ;
43
+ $ apacheCommands [] = 'a2enmod expires ' ;
44
+ $ apacheCommands [] = 'a2enmod mime ' ;
45
+ $ apacheCommands [] = 'a2enmod rewrite ' ;
46
+ $ apacheCommands [] = 'a2enmod env ' ;
47
+ $ apacheCommands [] = 'a2enmod ssl ' ;
48
+ $ apacheCommands [] = 'a2enmod actions ' ;
49
+ $ apacheCommands [] = 'a2enmod headers ' ;
50
+ $ apacheCommands [] = 'a2enmod suexec ' ;
51
+ $ apacheCommands [] = 'a2enmod ruid2 ' ;
52
+ $ apacheCommands [] = 'a2enmod proxy ' ;
53
+ $ apacheCommands [] = 'a2enmod proxy_http ' ;
54
+
55
+ // For Fast CGI
56
+ // $apacheCommands[] = 'a2enmod fcgid';
57
+ // $apacheCommands[] = 'a2enmod alias';
58
+ // $apacheCommands[] = 'a2enmod proxy_fcgi';
59
+ // $apacheCommands[] = 'a2enmod setenvif';
60
+
61
+ // $apacheCommands[] = 'ufw allow in "Apache Full"';
62
+
63
+
64
+ $ dependenciesListApache = [
40
65
'apache2 ' ,
41
66
'apache2-suexec-custom ' ,
42
67
'libapache2-mod-ruid2 '
43
68
];
69
+
70
+ $ dependenciesApache = implode (' ' , $ dependenciesListApache );
71
+ $ commands [] = 'apt-get install -yq ' . $ dependenciesApache ;
72
+ $ commands = array_merge ($ commands , $ apacheCommands );
73
+
44
74
if (!empty ($ this ->phpVersions )) {
45
75
foreach ($ this ->phpVersions as $ phpVersion ) {
46
- $ dependenciesList [] = 'libapache2-mod-php ' . $ phpVersion ;
47
- }
48
- if (!empty ($ this ->phpModules )) {
49
- foreach ($ this ->phpVersions as $ phpVersion ) {
50
- $ dependenciesList [] = 'php ' . $ phpVersion ;
51
- $ dependenciesList [] = 'php ' . $ phpVersion . '-cgi ' ;
52
- $ dependenciesList [] = 'php ' . $ phpVersion . '-{ ' . implode (', ' , $ this ->phpModules ) . '} ' ;
76
+
77
+ $ dependenciesListPHP = [];
78
+ $ dependenciesListPHP [] = 'php ' .$ phpVersion ;
79
+ $ dependenciesListPHP [] = 'libapache2-mod-php ' .$ phpVersion ;
80
+ $ dependenciesListPHP [] = 'php ' .$ phpVersion ;
81
+ $ dependenciesListPHP [] = 'php ' .$ phpVersion .'-cgi ' ;
82
+
83
+ if (!empty ($ this ->phpModules )) {
84
+ $ dependenciesListPHP [] = 'php ' .$ phpVersion .'-{ ' .implode (', ' ,
85
+ $ this ->phpModules ).'} ' ;
53
86
}
87
+
88
+ $ dependenciesPHP = implode (' ' , $ dependenciesListPHP );
89
+ $ commands [] = 'apt-get install -yq ' .$ dependenciesPHP ;
54
90
}
55
- }
56
91
92
+ }
57
93
58
- $ dependencies = implode (' ' , $ dependenciesList );
59
- $ commands [] = 'apt-get install -yq ' . $ dependencies ;
60
94
61
95
$ lastItem = end ($ this ->phpVersions );
62
96
foreach ($ this ->phpVersions as $ phpVersion ) {
@@ -67,27 +101,7 @@ public function install()
67
101
}
68
102
}
69
103
70
- $ commands [] = 'a2enmod cgi ' ;
71
- $ commands [] = 'a2enmod deflate ' ;
72
- $ commands [] = 'a2enmod expires ' ;
73
- $ commands [] = 'a2enmod mime ' ;
74
- $ commands [] = 'a2enmod rewrite ' ;
75
- $ commands [] = 'a2enmod env ' ;
76
- $ commands [] = 'a2enmod ssl ' ;
77
- $ commands [] = 'a2enmod actions ' ;
78
- $ commands [] = 'a2enmod headers ' ;
79
- $ commands [] = 'a2enmod suexec ' ;
80
- $ commands [] = 'a2enmod ruid2 ' ;
81
- $ commands [] = 'a2enmod proxy ' ;
82
- $ commands [] = 'a2enmod proxy_http ' ;
83
-
84
- // For Fast CGI
85
- // $commands[] = 'a2enmod fcgid';
86
- // $commands[] = 'a2enmod alias';
87
- // $commands[] = 'a2enmod proxy_fcgi';
88
- // $commands[] = 'a2enmod setenvif';
89
104
90
- // $commands[] = 'ufw allow in "Apache Full"';
91
105
$ commands [] = 'systemctl restart apache2 ' ;
92
106
$ commands [] = 'phyre-php /usr/local/phyre/web/artisan phyre:run-repair ' ;
93
107
$ commands [] = 'apt-get autoremove -yq ' ;
0 commit comments