These forums are locked and archived, but all topics have been migrated to the new forum. You can search for this topic on the new forum: Search for virtual server not executing PHP after Virtualmin 5.03 upgrade on the new forum.
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
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
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.
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
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
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
What SetHandler line is that please ?
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
i got that on new ubuntu 16.04 install, then i install roundcube and it downloads .php files
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
yes latest, i installed it day ago
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
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