it was with FCGId , switch to FPM into server template as no effect after restart apache: always in 5.6
If it can help,here is /etc/apache2/sites-available/mydomain.com.conf
SuexecUserGroup “#1000” “#1000”
ServerName mydomain.com
ServerAlias www.mydomain.com
ServerAlias webmail.mydomain.com
ServerAlias admin.mydomain.com
ServerAlias seconddomain.com
ServerAlias www.seconddomain.com
DocumentRoot /home/mydomain/public_html
ErrorLog /var/log/virtualmin/mydomain.com_error_log
CustomLog /var/log/virtualmin/mydomain.com_access_log combined
ScriptAlias /cgi-bin/ /home/mydomain/cgi-bin/
ScriptAlias /awstats/ /home/mydomain/cgi-bin/
DirectoryIndex index.html index.htm index.php index.php4 index.php5
<Directory /home/mydomain/public_html>
Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch +ExecCGI
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
Require all granted
AddType application/x-httpd-php .php
AddHandler fcgid-script .php
AddHandler fcgid-script .php5
AddHandler fcgid-script .php7.1
AddHandler fcgid-script .php7.2
FCGIWrapper /home/mydomain/fcgi-bin/php7.2.fcgi .php
FCGIWrapper /home/mydomain/fcgi-bin/php5.fcgi .php5
FCGIWrapper /home/mydomain/fcgi-bin/php7.1.fcgi .php7.1
FCGIWrapper /home/mydomain/fcgi-bin/php7.2.fcgi .php7.2
<Directory /home/mydomain/cgi-bin>
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
Require all granted
RewriteEngine on
RewriteCond %{HTTP_HOST} =webmail.mydomain.com
RewriteRule ^(.*) https://mydomain.com:20000/ [R]
RewriteCond %{HTTP_HOST} =admin.mydomain.com
RewriteRule ^(.*) https://mydomain.com:10000/ [R]
RemoveHandler .php
RemoveHandler .php5
RemoveHandler .php7.1
RemoveHandler .php7.2
php_admin_value engine Off
FcgidMaxRequestLen 1073741824
Alias /dav /home/mydomain/public_html
Alias /pipermail /var/lib/mailman/archives/public
<Location /dav>
DAV on
AuthType Basic
AuthName “mydomain.com”
AuthUserFile /home/mydomain/etc/dav.digest.passwd
Require valid-user
ForceType text/plain
Satisfy All
RemoveHandler .php
RemoveHandler .php5
RewriteEngine off
AuthName “mydomain.com statistics”
AuthType Basic
AuthUserFile /home/mydomain/.awstats-htpasswd
require valid-user
RedirectMatch /cgi-bin/mailman/([^/.])(.cgi)?(.) https://mydomain.com:10000/virtualmin-mailman/unauthenticated/$1.cgi$3
RedirectMatch /mailman/([^/.])(.cgi)?(.) https://mydomain.com:10000/virtualmin-mailman/unauthenticated/$1.cgi$3
php_value memory_limit 512M
IPCCommTimeout 31