Apache 2.4 + fcgid: file not found

I have php 5.6 and php 7.1 on my server, I created a manual virtualhost and work fine, I change only the directive

SetHandler "proxy:unix:/var/run/php/php7.1-fpm.sock|fcgi://localhost" to SetHandler "proxy:unix:/var/run/php/php5.6-fpm.sock|fcgi://localhost" for use different PHP version.

Now I installed webmin+virtualmin, in the server template under section “PHP Option” I use FCGId option.
I created a new basic Virtual server trough the gui, this is the conf

SetHandler "proxy:unix:/var/run/php/php5.6-fpm.sock|fcgi://localhost" SuexecUserGroup "#1011" "#1012" ServerName mydomain.com ServerAlias www.mydomain.com DocumentRoot /home/five6/public_html ErrorLog /var/log/virtualmin/mydomain.com_error_log CustomLog /var/log/virtualmin/mydomain.com_access_log combined ScriptAlias /cgi-bin/ /home/five6/cgi-bin/ DirectoryIndex index.html index.htm index.php index.php4 index.php5 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.6 AddHandler fcgid-script .php7.1 FCGIWrapper /home/five6/fcgi-bin/php7.1.fcgi .php FCGIWrapper /home/five6/fcgi-bin/php5.6.fcgi .php5.6 FCGIWrapper /home/five6/fcgi-bin/php7.1.fcgi .php7.1 allow from all AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch Require all granted RewriteEngine on RewriteCond %{HTTP_HOST} =webmail.mydomain.com RewriteRule ^(.*) http://mydomain.com:20000/ [R] RewriteCond %{HTTP_HOST} =admin.mydomain.com RewriteRule ^(.*) https://mydomain.com:10000/ [R] RemoveHandler .php RemoveHandler .php5.6 RemoveHandler .php7.1 FcgidMaxRequestLen 1073741824 IPCCommTimeout 31

On the browser if I put http://mydomain.com/index.php I see “File not found”, any html/html file works perfect but not .php fie.

The log file:

access.log (GET /index.php HTTP/1.1" 404 245)
error.log ([proxy_fcgi:error] [pid 6025:tid 139900934399744] [client IP:48300] AH01071: Got error ‘Primary script unknown\n’

Apache modules:

apachectl -M
Loaded Modules:
core_module (static)
so_module (static)
watchdog_module (static)
http_module (static)
log_config_module (static)
logio_module (static)
version_module (static)
unixd_module (static)
access_compat_module (shared)
actions_module (shared)
alias_module (shared)
auth_basic_module (shared)
authn_core_module (shared)
authn_file_module (shared)
authz_core_module (shared)
authz_host_module (shared)
authz_user_module (shared)
autoindex_module (shared)
cgid_module (shared)
deflate_module (shared)
dir_module (shared)
env_module (shared)
fcgid_module (shared)
filter_module (shared)
headers_module (shared)
include_module (shared)
mime_module (shared)
mpm_worker_module (shared)
negotiation_module (shared)
proxy_module (shared)
proxy_fcgi_module (shared)
rewrite_module (shared)
setenvif_module (shared)
socache_shmcb_module (shared)
ssl_module (shared)
status_module (shared)
suexec_module (shared)
userdir_module (shared)
vhost_alias_module (shared)

Please help me.
:frowning:
Best regards

Hi All
if I change the index.php file on /home/five6/public_html to www-data:www-data the file working fine.

This is my

more /etc/apache2/suexec/www-data
/home
public_html/cgi-bin

Any idea?

If this problem is what i suspect it is then you can expect a lot of troubles and bugs down the line. Correct me if i’m wrong but did you install Apache (LAMP) on your server before Virtualmin?

If the answer is yes then i would suggest to delete everything and start again, but this time after the OS dont install anything extra(!) before you installed Virtualmin.