I installed Virtualmin for the first time on Debian 7 like I already did a zillion times before on Debian 6. As usual, I ran this on a freshly installed dedicated server:
chmod +x install.sh
… ans answered the usual questions of the post-install process.
Everything went fine (thanks a lot for this great panel, you guys rock … but still, I’m runing into a strange problem: whenever I try to switch a website’s PHP execution mode to “Apache mod_php”, the code seems to be not interpreted and shows up in the browser.
Same symptom if I try to put some PHP scripts in /var/www, just have a look here : http://18.104.22.168/phpinfo.php
Am I the only one concerned ? Any clue ?
Hmm, that’s an unusual issue!
If you go into System Settings -> Re-Check Config, does it detect any errors?
Thank you for the quick answer. Virtualmin seems to be happy :
The status of your system is being checked to ensure that all enabled features are available, that the mail server is properly configured, and that quotas are active …
Your system has 1.94 GB of memory, which is at or above the Virtualmin recommended minimum of 256 MB.
BIND DNS server is installed, and the system is configured to use it.
Mail server Postfix is installed and configured.
Postfix is configured to support per-domain outgoing IP addresses.
Apache is installed.
The following PHP versions are available : 5.4.4 (/usr/bin/php5-cgi)
Webalizer is installed.
Apache is configured to host SSL websites.
MySQL is installed and running.
ProFTPd is installed.
Logrotate is installed.
SpamAssassin and Procmail are installed and configured for use.
ClamAV is installed and assumed to be running.
Plugin AWstats reporting is installed OK.
Plugin DAV Login is installed OK.
Plugin Mailman is installed OK.
Plugin Protected web directories is installed OK.
Using network interface eth0 for virtual IPs.
IPv6 addresses are available, using interface eth0.
Default IP address for virtual servers is 22.214.171.124.
Default IP address is set to 126.96.36.199, which matches the detected external address.
Both user and group quotas are enabled for home and email directories.
All commands needed to create and restore backups are installed.
The selected package management and update systems are installed OK.
… your system is ready for use by Virtualmin.
I agree: this is quite odd. I wonder if I don’t have some kernel issue here, this is my next testing step. Meanwhile, any idea is very welcome
Please check /etc/apache2/mods-enabled/php5.conf
to see if/that the two SetHandler lines are commented out.
Hey, that was it!
Thank you very much indeed
Mmm… It seems to be a little more tricky: if I comment the 2 “SetHandler” lines, I get the exact opposite situation :
- PHP scripts are interpreted in /var/www AND for websites runing “Apache mod_php”.
- Unfortunatly, websites runing FCGId show the code in the browser
Here is my /etc/apache2/mods-enabled/php5.conf :
# Deny access to raw php sources by default
# To re-enable it’s recommended to enable access to the files
# only in specific virtual host or directory
Deny from all
Deny access to files without filename (e.g. ‘.php’)
Deny from all
Running PHP scripts in user directories is disabled by default
To re-enable PHP in user directories comment the following lines
(from <IfModule …> to .) Do NOT set it to On as it
prevents .htaccess files from disabling it.
php_admin_value engine Off
Any further idea ?
I had the same issue.
In my case it was a mime-type issue.
In the global apache configuration go to mime types.
Check if application/x-httpd-php is in the list.
“Add new mimetype”
MIME type = application/x-httpd-php
extensions = php
That worked for me.
Bingo, that was it: the line…
application/x-httpd-php phtml pht php
… was commented in /etc/mime.types. Thanks a lot Goeny.
@ the dev team : wouldn’t it be a good idea to add a few lines to the install script in order to check this ?
Fixed it for me too, thanks!
Had the same issue on fresh Ubuntu 14.04 installation.
Adding mime type helped!
It was a mime type issue here as well (Ubuntu 14.04).
Not sure why but the line was commented out in /etc/mime.types .