Browse Source

Merge pull request #7516 from nextcloud/bugfix/7499/fpm-prefork-warning

Add a warning when FPM is used with MPM_PREFORK
pull/7538/head
Joas Schilling 3 years ago
committed by GitHub
parent
commit
076db31146
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 21
      lib/Settings/Admin/AdminSettings.php
  2. 15
      src/components/AdminSettings/WebServerSetupChecks.vue

21
lib/Settings/Admin/AdminSettings.php

@ -97,6 +97,7 @@ class AdminSettings implements ISettings {
$this->initialState->provideInitialState('default_group_notification', (int) $this->serverConfig->getAppValue('spreed', 'default_group_notification', Participant::NOTIFY_MENTION));
$this->initialState->provideInitialState('conversations_files', (int) $this->serverConfig->getAppValue('spreed', 'conversations_files', '1'));
$this->initialState->provideInitialState('conversations_files_public_shares', (int) $this->serverConfig->getAppValue('spreed', 'conversations_files_public_shares', '1'));
$this->initialState->provideInitialState('valid_apache_php_configuration', (int) $this->validApachePHPConfiguration());
}
protected function initAllowedGroups(): void {
@ -497,6 +498,26 @@ class AdminSettings implements ISettings {
return $groups;
}
protected function validApachePHPConfiguration(): bool {
$output = [];
@exec('apachectl -M | grep mpm', $output, $returnCode);
if ($returnCode > 0) {
return true;
}
$apacheModule = implode("\n", $output);
$usingFPM = ini_get('fpm.config') !== false;
if ($usingFPM) {
// Needs to use mpm_event
return strpos($apacheModule, 'mpm_event') !== false;
}
// Needs to use mpm_prefork
return strpos($apacheModule, 'mpm_prefork') !== false;
}
/**
* @return string the section ID, e.g. 'sharing'
*/

15
src/components/AdminSettings/WebServerSetupChecks.vue

@ -24,6 +24,11 @@
{{ t('spreed', 'Web server setup checks') }}
</h2>
<p v-if="!validApachePHPConfiguration"
class="settings-hint warning">
{{ apacheWarning }}
</p>
<ul class="web-server-setup-checks">
<li class="background-blur">
{{ t('spreed', 'Files required for background blur can be loaded') }}
@ -55,6 +60,7 @@ import Tooltip from '@nextcloud/vue/dist/Directives/Tooltip'
import { VIRTUAL_BACKGROUND_TYPE } from '../../utils/media/effects/virtual-background/constants.js'
import JitsiStreamBackgroundEffect from '../../utils/media/effects/virtual-background/JitsiStreamBackgroundEffect.js'
import VirtualBackground from '../../utils/media/pipeline/VirtualBackground.js'
import { loadState } from '@nextcloud/initial-state'
export default {
name: 'WebServerSetupChecks',
@ -66,6 +72,7 @@ export default {
data() {
return {
backgroundBlurLoaded: undefined,
validApachePHPConfiguration: true,
}
},
@ -109,6 +116,14 @@ export default {
return t('spreed', 'Checking …')
},
apacheWarning() {
return t('spreed', 'It seems that the PHP and Apache configuration is not compatible. Please note that PHP can only be used with the MPM_PREFORK module and PHP-FPM can only be used with the MPM_EVENT module.')
},
},
mounted() {
this.validApachePHPConfiguration = parseInt(loadState('spreed', 'valid_apache_php_configuration')) === 1
},
beforeMount() {

Loading…
Cancel
Save