Skip to content

Commit 23933ba

Browse files
author
gau1991
committed
Fix slow log issue with PHP5.6
1 parent e71db96 commit 23933ba

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

ee/cli/plugins/debug.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,17 @@ def debug_php(self):
180180
";zend_extension",
181181
"zend_extension")
182182

183+
# Fix slow log is not enabled default in PHP5.6
184+
config = configparser.ConfigParser()
185+
config.read('/etc/php5/fpm/pool.d/debug.conf')
186+
config['debug']['slowlog'] = '/var/log/php5/slow.log'
187+
config['debug']['request_slowlog_timeout'] = '10s'
188+
with open('/etc/php5/fpm/pool.d/debug.conf',
189+
encoding='utf-8', mode='w') as confifile:
190+
Log.debug(self, "Writting debug.conf configuration into "
191+
"/etc/php5/fpm/pool.d/debug.conf")
192+
config.write(confifile)
193+
183194
self.trigger_php = True
184195
self.trigger_nginx = True
185196
else:

ee/cli/plugins/stack.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,8 @@ def post_pref(self, apt_packages, packages):
545545
config.read('/etc/php5/fpm/pool.d/debug.conf')
546546
config['debug']['listen'] = '127.0.0.1:9001'
547547
config['debug']['rlimit_core'] = 'unlimited'
548+
config['debug']['slowlog'] = '/var/log/php5/slow.log'
549+
config['debug']['request_slowlog_timeout'] = '10s'
548550
with open('/etc/php5/fpm/pool.d/debug.conf',
549551
encoding='utf-8', mode='w') as confifile:
550552
Log.debug(self, "writting PHP5 configuration into "

0 commit comments

Comments
 (0)