diff --git a/plogical/phpUtilities.py b/plogical/phpUtilities.py index 8e69569ef..3e15258bf 100755 --- a/plogical/phpUtilities.py +++ b/plogical/phpUtilities.py @@ -100,6 +100,8 @@ class phpUtilities: def savePHPConfigBasic(phpVers,allow_url_fopen,display_errors,file_uploads,allow_url_include,memory_limit,max_execution_time,upload_max_filesize,max_input_time,post_max_size): try: serverLevelPHPRestart = '/usr/local/lsws/admin/tmp/.lsphp_restart.txt' + + command = 'touch %s' % (serverLevelPHPRestart) ProcessUtilities.executioner(command) diff --git a/plogical/vhost.py b/plogical/vhost.py index 78ef56d0f..f97ec6898 100755 --- a/plogical/vhost.py +++ b/plogical/vhost.py @@ -612,6 +612,10 @@ class vhost: @staticmethod def changePHP(vhFile, phpVersion): + + from pathlib import Path + HomePath = Path("/home/%s" % (vhFile.split('/')[-2])) + virtualHostUser = HomePath.owner() phpDetachUpdatePath = '/home/%s/.lsphp_restart.txt' % (vhFile.split('/')[-2]) if ProcessUtilities.decideServer() == ProcessUtilities.OLS: try: @@ -636,12 +640,13 @@ class vhost: writeDataToFile.close() - writeToFile = open(phpDetachUpdatePath, 'w') - writeToFile.close() + command = 'sudo -u %s touch %s' % (virtualHostUser, phpDetachUpdatePath) + ProcessUtilities.normalExecutioner(command) installUtilities.installUtilities.reStartLiteSpeed() try: - os.remove(phpDetachUpdatePath) + command = 'sudo -u %s rm -f %s' % (virtualHostUser, phpDetachUpdatePath) + ProcessUtilities.normalExecutioner(command) except: pass else: