virtual server not executing PHP after Virtualmin 5.03 upgrade

13 posts / 0 new
Last post
#1 Sun, 05/22/2016 - 16:11
donnyspi

virtual server not executing PHP after Virtualmin 5.03 upgrade

After I upgraded to VIrtualmin 5.03, when I add a virtual sub-server PHP doesn't execute, it's just downloads the file for that new sub-server. Tried deleting/re-adding. I can't figure it out. Please halp. Ubuntu 16.04, PHP7.

Thanks, Don

Sun, 05/22/2016 - 16:38
andreychek

Howdy,

It sounds like an Apache/PHP config may have gotten changed around the same time.

What you're describing can happen if there is a SetHandler line in /etc/apache2 somewhere that is overriding the domain's PHP settings.

What is the output of this command:

find /etc/apache2 | xargs grep -i sethandler

Also, do you see any errors or problems if you go into System Settings -> Re-Check Config?

-Eric

Sun, 05/22/2016 - 17:33
donnyspi
grep: /etc/apache2: Is a directory
grep: /etc/apache2/conf-enabled: Is a directory
/etc/apache2/conf-enabled/localized-error-pages.conf:#            SetHandler directive in a <Location /> context somewhere. Adding
/etc/apache2/conf-enabled/localized-error-pages.conf:#                   SetHandler none
grep: /etc/apache2/conf-available: Is a directory
/etc/apache2/conf-available/php7.0-cgi.conf:    SetHandler application/x-httpd-php
/etc/apache2/conf-available/php7.0-cgi.conf:    SetHandler application/x-httpd-php-source
/etc/apache2/conf-available/localized-error-pages.conf:#                  SetHandler directive in a <Location /> context somewhere. Adding
/etc/apache2/conf-available/localized-error-pages.conf:#                         SetHandler none
grep: /etc/apache2/sites-enabled: Is a directory
grep: /etc/apache2/suexec: Is a directory
grep: /etc/apache2/sites-available: Is a directory
grep: /etc/apache2/mods-available: Is a directory
/etc/apache2/mods-available/proxy_balancer.conf:        #          SetHandler balancer-manager
/etc/apache2/mods-available/php7.0.conf:    SetHandler application/x-httpd-php
/etc/apache2/mods-available/php7.0.conf:    SetHandler application/x-httpd-php-source
/etc/apache2/mods-available/status.conf:                SetHandler server-status
/etc/apache2/mods-available/ldap.conf:  SetHandler ldap-status
/etc/apache2/mods-available/info.conf:          SetHandler server-info
grep: /etc/apache2/mods-enabled: Is a directory
/etc/apache2/mods-enabled/php7.0.conf:    SetHandler application/x-httpd-php
/etc/apache2/mods-enabled/php7.0.conf:    SetHandler application/x-httpd-php-source
/etc/apache2/mods-enabled/status.conf:          SetHandler server-status

Re-Check config checked out ok for the domain in question.
Sun, 05/22/2016 - 17:34
donnyspi

grep: /etc/apache2: Is a directory
grep: /etc/apache2/conf-enabled: Is a directory
/etc/apache2/conf-enabled/localized-error-pages.conf:# SetHandler directive in a <Location /> context somewhere. Adding
/etc/apache2/conf-enabled/localized-error-pages.conf:# SetHandler none
grep: /etc/apache2/conf-available: Is a directory
/etc/apache2/conf-available/php7.0-cgi.conf: SetHandler application/x-httpd-php
/etc/apache2/conf-available/php7.0-cgi.conf: SetHandler application/x-httpd-php-source
/etc/apache2/conf-available/localized-error-pages.conf:# SetHandler directive in a <Location /> context somewhere. Adding
/etc/apache2/conf-available/localized-error-pages.conf:# SetHandler none
grep: /etc/apache2/sites-enabled: Is a directory
grep: /etc/apache2/suexec: Is a directory
grep: /etc/apache2/sites-available: Is a directory
grep: /etc/apache2/mods-available: Is a directory
/etc/apache2/mods-available/proxy_balancer.conf: # SetHandler balancer-manager
/etc/apache2/mods-available/php7.0.conf: SetHandler application/x-httpd-php
/etc/apache2/mods-available/php7.0.conf: SetHandler application/x-httpd-php-source
/etc/apache2/mods-available/status.conf: SetHandler server-status
/etc/apache2/mods-available/ldap.conf: SetHandler ldap-status
/etc/apache2/mods-available/info.conf: SetHandler server-info
grep: /etc/apache2/mods-enabled: Is a directory
/etc/apache2/mods-enabled/php7.0.conf: SetHandler application/x-httpd-php
/etc/apache2/mods-enabled/php7.0.conf: SetHandler application/x-httpd-php-source
/etc/apache2/mods-enabled/status.conf: SetHandler server-status

Sun, 05/22/2016 - 17:52
donnyspi

ok fixed it. I compared an Apache conf file from a known good domain and a new one. When I comment out these two lines from the new one it works:

#FcgidMaxRequestLen 1073741824
#php_admin_value engine Off

Don

Sun, 05/22/2016 - 17:52
andreychek

There we go, open up "/etc/apache2/mods-enabled/php7.0.conf", and comment out the various SetHandler lines you see in there. Then restart Apache.

After doing that, do things go back to normal?

-Eric

Sat, 06/04/2016 - 08:05 (Reply to #6)
hostile

What SetHandler line is that please ?

Sun, 05/22/2016 - 17:57
andreychek

Glad you were able to get it working!

I would still recommend commenting out those SetHandler lines... those lines are commented out by default during the installation for that reason. They cause a strange conflict when trying to use FCGID/CGI.

That said, I mis-read your initial post, thinking you were seeing that issue with all domains. Knowing that -- I'm actually not quite sure why it's working at the moment :-)

Do you know what PHP Execution Mode is being used? You can determine that by looking in Server Configuration -> Website Options.

-Eric

Mon, 05/30/2016 - 23:12
hostile

i got that on new ubuntu 16.04 install, then i install roundcube and it downloads .php files

Tue, 05/31/2016 - 08:00
andreychek

Are you using the newest version of the Virtualmin installer?

There's been a number of fixes added to that to improve the Ubuntu 16.04 support.

-Eric

Wed, 06/01/2016 - 06:17 (Reply to #10)
hostile

yes latest, i installed it day ago

Sun, 06/05/2016 - 01:08
hostile

after comenting out in /etc/apache2/sites-enabled/domain.com.conf

#FcgidMaxRequestLen 1073741824
#php_admin_value engine Off

roundcube works php being executed not downloaded

still gives error 500 after log in

Sun, 06/05/2016 - 01:08
hostile

There is still problem for me with this.

I commented out in /etc/apache2/sites-enabled/my.domain.com.conf

#FcgidMaxRequestLen 1073741824
#php_admin_value engine Off

It worked for http://domain.com/roundcube php executed

but if I go https://domain.com/roundcube php being downloaded not executed

What else to edit please?

cheers

ps.

I made post about it

https://www.virtualmin.com/node/40966

Topic locked