diff --git a/plugins/php/conf/php-fpm.conf b/plugins/php/conf/php-fpm.conf index 433896d70..004ea8e87 100644 --- a/plugins/php/conf/php-fpm.conf +++ b/plugins/php/conf/php-fpm.conf @@ -1,4 +1,6 @@ [global] +pid = run/php-fpm.pid +error_log = log/php-fpm.log include={$SERVER_PATH}/php/{$PHP_VERSION}/etc/php-fpm.d/*.conf php_value[auto_prepend_file]={$SERVER_PATH}/php/app_start.php \ No newline at end of file diff --git a/plugins/php/index.py b/plugins/php/index.py index 4ad244d4c..48cc6ab77 100755 --- a/plugins/php/index.py +++ b/plugins/php/index.py @@ -256,6 +256,9 @@ def initReplace(version): systemDir = '/usr/lib/systemd/system' systemService = systemDir + '/php' + version + '.service' systemServiceTpl = getPluginDir() + '/init.d/php.service.tpl' + if version == '52': + systemServiceTpl = getPluginDir() + '/init.d/php.service.52.tpl' + if os.path.exists(systemDir) and not os.path.exists(systemService): service_path = mw.getServerDir() se_content = mw.readFile(systemServiceTpl) diff --git a/plugins/php/init.d/php.service.bak.tpl b/plugins/php/init.d/php.service.52.tpl similarity index 64% rename from plugins/php/init.d/php.service.bak.tpl rename to plugins/php/init.d/php.service.52.tpl index 9a02235e2..d837568e8 100644 --- a/plugins/php/init.d/php.service.bak.tpl +++ b/plugins/php/init.d/php.service.52.tpl @@ -8,9 +8,8 @@ After=network.target [Service] Type=forking -ExecStart={$SERVER_PATH}/php/{$VERSION}/sbin/php-fpm --daemonize --fpm-config {$SERVER_PATH}/php/{$VERSION}/etc/php-fpm.conf -ExecStop=/bin/kill -INT $MAINPID -ExecReload=/bin/kill -USR2 $MAINPID +ExecStart={$SERVER_PATH}/php/init.d/php{$VERSION} start +ExecStop={$SERVER_PATH}/php/init.d/php{$VERSION} stop PrivateTmp=false [Install] diff --git a/plugins/php/init.d/php.service.tpl b/plugins/php/init.d/php.service.tpl index 0d5beb87d..d2ff7bebd 100644 --- a/plugins/php/init.d/php.service.tpl +++ b/plugins/php/init.d/php.service.tpl @@ -7,10 +7,9 @@ Description=The PHP {$VERSION} FastCGI Process Manager After=network.target [Service] -Type=forking -ExecStart={$SERVER_PATH}/php/init.d/php{$VERSION} start -ExecStop={$SERVER_PATH}/php/init.d/php{$VERSION} stop -ExecReload={$SERVER_PATH}/php/init.d/php{$VERSION} reload +PIDFile={$SERVER_PATH}/php/{$VERSION}/var/run/php-fpm.pid +ExecStart={$SERVER_PATH}/php/{$VERSION}/sbin/php-fpm --nondaemonize --fpm-config {$SERVER_PATH}/php/{$VERSION}/etc/php-fpm.conf +ExecReload=/bin/kill -USR2 $MAINPID PrivateTmp=false [Install] diff --git a/scripts/install/centos.sh b/scripts/install/centos.sh index 71b06ed81..adc375729 100755 --- a/scripts/install/centos.sh +++ b/scripts/install/centos.sh @@ -77,6 +77,7 @@ if [ "$?" != "0" ];then yum install -y dnf dnf-plugins-core dnf config-manager --set-enabled powertools yum install -y oniguruma oniguruma-devel + dnf upgrade -y libmodulemd fi yum install -y libzstd-devel