Skip to content

Commit 4b759da

Browse files
committed
Merge branch 'release/v3.7.0'
2 parents fc7b61b + fbb50e3 commit 4b759da

File tree

11 files changed

+217
-37
lines changed

11 files changed

+217
-37
lines changed

CHANGELOG.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
v3.7.0 - Jun 22, 2016
2+
- PHP7 support for debian jessie
3+
- Fixed Issue #729, #724
4+
15
v3.6.2 - Jun 03, 2016
26
- Fix Issue #726,#723,#727
37
- Update Adminer to v4.2.5

ee/cli/plugins/debug.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ def debug_php7(self):
293293
# PHP global debug start
294294

295295
if (self.app.pargs.php7 == 'on' and not self.app.pargs.site_name):
296-
if (EEVariables.ee_platform_distro == 'debian' or EEVariables.ee_platform_codename == 'precise'):
296+
if (EEVariables.ee_platform_codename == 'wheezy' or EEVariables.ee_platform_codename == 'precise'):
297297
Log.error(self,"PHP 7.0 not supported.")
298298
if not (EEShellExec.cmd_exec(self, "sed -n \"/upstream php7"
299299
"{/,/}/p \" /etc/nginx/"
@@ -311,7 +311,13 @@ def debug_php7(self):
311311
nc.savef('/etc/nginx/conf.d/upstream.conf')
312312

313313
# Enable xdebug
314-
EEFileUtils.searchreplace(self, "/etc/php/7.0/mods-available/"
314+
if (EEVariables.ee_platform_codename != 'jessie'):
315+
EEFileUtils.searchreplace(self, "/etc/php/7.0/mods-available/"
316+
"xdebug.ini",
317+
";zend_extension",
318+
"zend_extension")
319+
else:
320+
EEFileUtils.searchreplace(self, "/etc/php/mods-available/"
315321
"xdebug.ini",
316322
";zend_extension",
317323
"zend_extension")
@@ -350,7 +356,13 @@ def debug_php7(self):
350356
nc.savef('/etc/nginx/conf.d/upstream.conf')
351357

352358
# Disable xdebug
353-
EEFileUtils.searchreplace(self, "/etc/php/7.0/mods-available/"
359+
if (EEVariables.ee_platform_codename != 'jessie'):
360+
EEFileUtils.searchreplace(self, "/etc/php/7.0/mods-available/"
361+
"xdebug.ini",
362+
"zend_extension",
363+
";zend_extension")
364+
else:
365+
EEFileUtils.searchreplace(self, "/etc/php/mods-available/"
354366
"xdebug.ini",
355367
"zend_extension",
356368
";zend_extension")

ee/cli/plugins/site_functions.py

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -733,12 +733,17 @@ def site_package_check(self, stype):
733733
if not EEAptGet.is_installed(self, 'php7.0-fpm'):
734734
apt_packages = apt_packages + EEVariables.ee_php7_0 + EEVariables.ee_php_extra
735735
else:
736-
Log.warn(self, "PHP 7.0 not available for your system.")
737-
Log.info(self,"Creating site with PHP 5.6")
738-
if not EEAptGet.is_installed(self, 'php5-fpm'):
739-
Log.info(self, "Setting apt_packages variable for PHP")
740-
Log.debug(self, "Setting apt_packages variable for PHP")
741-
apt_packages = apt_packages + EEVariables.ee_php
736+
if EEVariables.ee_platform_codename == 'wheezy':
737+
Log.warn(self, "PHP 7.0 not available for your system.")
738+
Log.info(self,"Creating site with PHP 5.6")
739+
if not EEAptGet.is_installed(self, 'php5-fpm'):
740+
Log.info(self, "Setting apt_packages variable for PHP")
741+
Log.debug(self, "Setting apt_packages variable for PHP")
742+
apt_packages = apt_packages + EEVariables.ee_php
743+
else:
744+
Log.debug(self, "Setting apt_packages variable for PHP 7.0")
745+
if not EEAptGet.is_installed(self, 'php7.0-fpm'):
746+
apt_packages = apt_packages + EEVariables.ee_php7_0
742747

743748
if stype in ['mysql', 'wp', 'wpsubdir', 'wpsubdomain']:
744749
Log.debug(self, "Setting apt_packages variable for MySQL")
@@ -858,7 +863,7 @@ def site_package_check(self, stype):
858863
"server 127.0.0.1:9000 backup;\n}\n")
859864

860865
if self.app.pargs.php7:
861-
if (EEVariables.ee_platform_distro == 'debian' or EEVariables.ee_platform_codename == 'precise'):
866+
if (EEVariables.ee_platform_codename == 'wheezy' or EEVariables.ee_platform_codename == 'precise'):
862867
Log.error(self,"PHP 7.0 is not supported in your Platform")
863868

864869
Log.debug(self, "Setting apt_packages variable for PHP 7.0")

ee/cli/plugins/stack.py

Lines changed: 167 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,13 @@ def pre_pref(self, apt_packages):
209209
Log.debug(self, 'Adding ppa for PHP')
210210
EERepo.add(self, ppa=EEVariables.ee_php_repo)
211211

212+
if EEVariables.ee_platform_codename == 'jessie':
213+
if set(EEVariables.ee_php7_0).issubset(set(apt_packages)):
214+
Log.debug(self, 'Adding repo_url of php 7.0 for debian')
215+
EERepo.add(self, repo_url=EEVariables.ee_php_repo)
216+
Log.debug(self, 'Adding Dotdeb/php GPG key')
217+
EERepo.add_key(self, '89DF5277')
218+
212219
if set(EEVariables.ee_hhvm).issubset(set(apt_packages)):
213220
if EEVariables.ee_platform_codename != 'xenial':
214221
Log.info(self, "Adding repository for HHVM, please wait...")
@@ -391,7 +398,7 @@ def post_pref(self, apt_packages, packages):
391398
ee_nginx.close()
392399

393400
#php7 conf
394-
if (EEVariables.ee_platform_codename == 'trusty' or EEVariables.ee_platform_codename == 'xenial') and (not
401+
if (EEVariables.ee_platform_codename == 'jessie' or EEVariables.ee_platform_codename == 'trusty' or EEVariables.ee_platform_codename == 'xenial') and (not
395402
os.path.isfile("/etc/nginx/common/php7.conf")):
396403
#data = dict()
397404
Log.debug(self, 'Writting the nginx configuration to '
@@ -1156,9 +1163,9 @@ def post_pref(self, apt_packages, packages):
11561163
EEGit.add(self, ["/etc/php"], msg="Adding PHP into Git")
11571164
EEService.restart_service(self, 'php5.6-fpm')
11581165

1159-
#preconfiguration for php7.0
1160-
if (EEVariables.ee_platform_codename == 'trusty' or EEVariables.ee_platform_codename == 'xenial') and set(EEVariables.ee_php7_0).issubset(set(apt_packages)):
1161-
# Create log directories
1166+
#PHP7.0 configuration for debian
1167+
if (EEVariables.ee_platform_codename == 'jessie' ) and set(EEVariables.ee_php7_0).issubset(set(apt_packages)):
1168+
# Create log directories
11621169
if not os.path.exists('/var/log/php/7.0/'):
11631170
Log.debug(self, 'Creating directory /var/log/php/7.0/')
11641171
os.makedirs('/var/log/php/7.0/')
@@ -1179,23 +1186,128 @@ def post_pref(self, apt_packages, packages):
11791186
config.write(configfile)
11801187

11811188
# Parse /etc/php/7.0/fpm/php-fpm.conf
1182-
'''
1183-
#Depreciated code. Mustache version applied
1189+
data = dict(pid="/run/php/php7.0-fpm.pid", error_log="/var/log/php7.0-fpm.log",
1190+
include="/etc/php/7.0/fpm/pool.d/*.conf")
1191+
Log.debug(self, "writting php 7.0 configuration into "
1192+
"/etc/php/7.0/fpm/php-fpm.conf")
1193+
ee_php_fpm = open('/etc/php/7.0/fpm/php-fpm.conf',
1194+
encoding='utf-8', mode='w')
1195+
self.app.render((data), 'php-fpm.mustache', out=ee_php_fpm)
1196+
ee_php_fpm.close()
1197+
1198+
# Parse /etc/php/7.0/fpm/pool.d/www.conf
11841199
config = configparser.ConfigParser()
1185-
Log.debug(self, "configuring php file"
1186-
"/etc/php/7.0/fpm/php-fpm.conf")
1187-
config.read_file(codecs.open("/etc/php/7.0/fpm/php-fpm.conf",
1200+
config.read_file(codecs.open('/etc/php/7.0/fpm/pool.d/www.conf',
11881201
"r", "utf8"))
1189-
config['global']['error_log'] = '/var/log/php/7.0/fpm.log'
1190-
config.remove_option('global', 'include')
1191-
config['global']['log_level'] = 'notice'
1192-
config['global']['include'] = '/etc/php/7.0/fpm/pool.d/*.conf'
1193-
with codecs.open('/etc/php/7.0/fpm/php-fpm.conf',
1202+
config['www']['ping.path'] = '/ping'
1203+
config['www']['pm.status_path'] = '/status'
1204+
config['www']['pm.max_requests'] = '500'
1205+
config['www']['pm.max_children'] = '100'
1206+
config['www']['pm.start_servers'] = '20'
1207+
config['www']['pm.min_spare_servers'] = '10'
1208+
config['www']['pm.max_spare_servers'] = '30'
1209+
config['www']['request_terminate_timeout'] = '300'
1210+
config['www']['pm'] = 'ondemand'
1211+
config['www']['listen'] = '127.0.0.1:9070'
1212+
with codecs.open('/etc/php/7.0/fpm/pool.d/www.conf',
11941213
encoding='utf-8', mode='w') as configfile:
1195-
Log.debug(self, "writting php5 configuration into "
1196-
"/etc/php/7.0/fpm/php-fpm.conf")
1214+
Log.debug(self, "writting PHP5 configuration into "
1215+
"/etc/php/7.0/fpm/pool.d/www.conf")
11971216
config.write(configfile)
1198-
'''
1217+
1218+
# Generate /etc/php/7.0/fpm/pool.d/debug.conf
1219+
EEFileUtils.copyfile(self, "/etc/php/7.0/fpm/pool.d/www.conf",
1220+
"/etc/php/7.0/fpm/pool.d/debug.conf")
1221+
EEFileUtils.searchreplace(self, "/etc/php/7.0/fpm/pool.d/"
1222+
"debug.conf", "[www]", "[debug]")
1223+
config = configparser.ConfigParser()
1224+
config.read('/etc/php/7.0/fpm/pool.d/debug.conf')
1225+
config['debug']['listen'] = '127.0.0.1:9170'
1226+
config['debug']['rlimit_core'] = 'unlimited'
1227+
config['debug']['slowlog'] = '/var/log/php/7.0/slow.log'
1228+
config['debug']['request_slowlog_timeout'] = '10s'
1229+
with open('/etc/php/7.0/fpm/pool.d/debug.conf',
1230+
encoding='utf-8', mode='w') as confifile:
1231+
Log.debug(self, "writting PHP5 configuration into "
1232+
"/etc/php/7.0/fpm/pool.d/debug.conf")
1233+
config.write(confifile)
1234+
1235+
with open("/etc/php/7.0/fpm/pool.d/debug.conf",
1236+
encoding='utf-8', mode='a') as myfile:
1237+
myfile.write("php_admin_value[xdebug.profiler_output_dir] "
1238+
"= /tmp/ \nphp_admin_value[xdebug.profiler_"
1239+
"output_name] = cachegrind.out.%p-%H-%R "
1240+
"\nphp_admin_flag[xdebug.profiler_enable"
1241+
"_trigger] = on \nphp_admin_flag[xdebug."
1242+
"profiler_enable] = off\n")
1243+
1244+
# Disable xdebug
1245+
if not EEShellExec.cmd_exec(self, "grep -q \';zend_extension\' /etc/php/mods-available/xdebug.ini"):
1246+
EEFileUtils.searchreplace(self, "/etc/php/mods-available/"
1247+
"xdebug.ini",
1248+
"zend_extension",
1249+
";zend_extension")
1250+
1251+
# PHP and Debug pull configuration
1252+
if not os.path.exists('{0}22222/htdocs/fpm/status/'
1253+
.format(EEVariables.ee_webroot)):
1254+
Log.debug(self, 'Creating directory '
1255+
'{0}22222/htdocs/fpm/status/ '
1256+
.format(EEVariables.ee_webroot))
1257+
os.makedirs('{0}22222/htdocs/fpm/status/'
1258+
.format(EEVariables.ee_webroot))
1259+
open('{0}22222/htdocs/fpm/status/debug'
1260+
.format(EEVariables.ee_webroot),
1261+
encoding='utf-8', mode='a').close()
1262+
open('{0}22222/htdocs/fpm/status/php'
1263+
.format(EEVariables.ee_webroot),
1264+
encoding='utf-8', mode='a').close()
1265+
1266+
# Write info.php
1267+
if not os.path.exists('{0}22222/htdocs/php/'
1268+
.format(EEVariables.ee_webroot)):
1269+
Log.debug(self, 'Creating directory '
1270+
'{0}22222/htdocs/php/ '
1271+
.format(EEVariables.ee_webroot))
1272+
os.makedirs('{0}22222/htdocs/php'
1273+
.format(EEVariables.ee_webroot))
1274+
1275+
with open("{0}22222/htdocs/php/info.php"
1276+
.format(EEVariables.ee_webroot),
1277+
encoding='utf-8', mode='w') as myfile:
1278+
myfile.write("<?php\nphpinfo();\n?>")
1279+
1280+
EEFileUtils.chown(self, "{0}22222"
1281+
.format(EEVariables.ee_webroot),
1282+
EEVariables.ee_php_user,
1283+
EEVariables.ee_php_user, recursive=True)
1284+
1285+
EEGit.add(self, ["/etc/php"], msg="Adding PHP into Git")
1286+
EEService.restart_service(self, 'php7.0-fpm')
1287+
1288+
#preconfiguration for php7.0
1289+
if (EEVariables.ee_platform_codename == 'trusty' or EEVariables.ee_platform_codename == 'xenial') and set(EEVariables.ee_php7_0).issubset(set(apt_packages)):
1290+
# Create log directories
1291+
if not os.path.exists('/var/log/php/7.0/'):
1292+
Log.debug(self, 'Creating directory /var/log/php/7.0/')
1293+
os.makedirs('/var/log/php/7.0/')
1294+
1295+
# Parse etc/php/7.0/fpm/php.ini
1296+
config = configparser.ConfigParser()
1297+
Log.debug(self, "configuring php file /etc/php/7.0/fpm/php.ini")
1298+
config.read('/etc/php/7.0/fpm/php.ini')
1299+
config['PHP']['expose_php'] = 'Off'
1300+
config['PHP']['post_max_size'] = '100M'
1301+
config['PHP']['upload_max_filesize'] = '100M'
1302+
config['PHP']['max_execution_time'] = '300'
1303+
config['PHP']['date.timezone'] = EEVariables.ee_timezone
1304+
with open('/etc/php/7.0/fpm/php.ini',
1305+
encoding='utf-8', mode='w') as configfile:
1306+
Log.debug(self, "Writting php configuration into "
1307+
"/etc/php/7.0/fpm/php.ini")
1308+
config.write(configfile)
1309+
1310+
# Parse /etc/php/7.0/fpm/php-fpm.conf
11991311
data = dict(pid="/run/php/php7.0-fpm.pid", error_log="/var/log/php/7.0/fpm.log",
12001312
include="/etc/php/7.0/fpm/pool.d/*.conf")
12011313
Log.debug(self, "writting php 7.0 configuration into "
@@ -2260,6 +2372,21 @@ def install(self, packages=[], apt_packages=[], disp_msg=True):
22602372
Log.debug(self, "PHP already installed")
22612373
Log.info(self, "PHP already installed")
22622374

2375+
#PHP 7.0 for Debian (jessie+)
2376+
if self.app.pargs.php7:
2377+
if (EEVariables.ee_platform_codename == 'jessie'):
2378+
Log.debug(self, "Setting apt_packages variable for PHP 7.0")
2379+
if not EEAptGet.is_installed(self, 'php7.0-fpm') :
2380+
apt_packages = apt_packages + EEVariables.ee_php7_0
2381+
if not EEAptGet.is_installed(self, 'php5-fpm'):
2382+
apt_packages = apt_packages + EEVariables.ee_php
2383+
else:
2384+
Log.debug(self, "PHP 7.0 already installed")
2385+
Log.info(self, "PHP 7.0 already installed")
2386+
else:
2387+
Log.debug(self, "PHP 7.0 Not Available for your Distribution")
2388+
Log.info(self, "PHP 7.0 Not Available for your Distribution")
2389+
22632390

22642391
if self.app.pargs.php7:
22652392
if (EEVariables.ee_platform_codename == 'trusty' or EEVariables.ee_platform_codename == 'xenial'):
@@ -2533,6 +2660,16 @@ def remove(self):
25332660
else:
25342661
apt_packages = apt_packages + EEVariables.ee_php
25352662

2663+
#PHP7.0 for debian(jessie+)
2664+
if self.app.pargs.php7:
2665+
if (EEVariables.ee_platform_codename == 'jessie'):
2666+
Log.debug(self, "Removing apt_packages variable of PHP 7.0")
2667+
apt_packages = apt_packages + EEVariables.ee_php7_0
2668+
if not EEAptGet.is_installed(self, 'php5-fpm'):
2669+
apt_packages = apt_packages + EEVariables.ee_php_extra
2670+
else:
2671+
Log.info(self,"PHP 7.0 not supported.")
2672+
25362673
if self.app.pargs.php7:
25372674
if (EEVariables.ee_platform_codename == 'trusty' or EEVariables.ee_platform_codename == 'xenial'):
25382675
Log.debug(self, "Removing apt_packages variable of PHP 7.0")
@@ -2615,6 +2752,7 @@ def remove(self):
26152752

26162753
Log.info(self, "Successfully removed packages")
26172754

2755+
#Added for Ondrej Repo missing package Fix
26182756
if self.app.pargs.php7:
26192757
if EEAptGet.is_installed(self, 'php5.6-fpm'):
26202758
Log.info(self, "PHP5.6-fpm found on system.")
@@ -2704,6 +2842,17 @@ def purge(self):
27042842
apt_packages = apt_packages + EEVariables.ee_php_extra
27052843
else:
27062844
apt_packages = apt_packages + EEVariables.ee_php
2845+
2846+
#For debian --php7
2847+
if self.app.pargs.php7:
2848+
if (EEVariables.ee_platform_codename == 'jessie'):
2849+
Log.debug(self, "Removing apt_packages variable of PHP 7.0")
2850+
apt_packages = apt_packages + EEVariables.ee_php7_0
2851+
if not EEAptGet.is_installed(self, 'php5-fpm'):
2852+
apt_packages = apt_packages + EEVariables.ee_php_extra
2853+
else:
2854+
Log.info(self,"PHP 7.0 not supported.")
2855+
27072856
if self.app.pargs.php7:
27082857
if (EEVariables.ee_platform_codename == 'trusty' or EEVariables.ee_platform_codename == 'xenial'):
27092858
Log.debug(self, "Removing apt_packages variable of PHP 7.0")
@@ -2788,6 +2937,7 @@ def purge(self):
27882937

27892938
Log.info(self, "Successfully purged packages")
27902939

2940+
#Added for php Ondrej repo missing package fix
27912941
if self.app.pargs.php7:
27922942
if EEAptGet.is_installed(self, 'php5.6-fpm'):
27932943
Log.info(self, "PHP5.6-fpm found on system.")

ee/cli/plugins/stack_upgrade.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,12 +167,13 @@ def default(self):
167167
apt_packages = apt_packages + EEVariables.ee_php
168168
else:
169169
Log.info(self, "PHP is not installed")
170+
if EEAptGet.is_installed(self, 'php7.0-fpm'):
171+
apt_packages = apt_packages + EEVariables.ee_php7_0
170172
else:
171173
if EEAptGet.is_installed(self, 'php5.6-fpm'):
172174
apt_packages = apt_packages + EEVariables.ee_php5_6 + EEVariables.ee_php_extra
173175
else:
174176
Log.info(self, "PHP 5.6 is not installed")
175-
176177
if EEAptGet.is_installed(self, 'php7.0-fpm'):
177178
apt_packages = apt_packages + EEVariables.ee_php7_0 + EEVariables.ee_php_extra
178179
else:

ee/cli/templates/redis-hhvm.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
set $skip_cache 0;
44
# POST requests and URL with a query string should always go to php
55
if ($request_method = POST) {
6-
set $skip_cache 0;
6+
set $skip_cache 1;
77
}
88
if ($query_string != "") {
99
set $skip_cache 1;

ee/cli/templates/redis-php7.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
set $skip_cache 0;
44
# POST requests and URL with a query string should always go to php
55
if ($request_method = POST) {
6-
set $skip_cache 0;
6+
set $skip_cache 1;
77
}
88
if ($query_string != "") {
99
set $skip_cache 1;

ee/cli/templates/redis.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
set $skip_cache 0;
44
# POST requests and URL with a query string should always go to php
55
if ($request_method = POST) {
6-
set $skip_cache 0;
6+
set $skip_cache 1;
77
}
88
if ($query_string != "") {
99
set $skip_cache 1;

0 commit comments

Comments
 (0)