PHP not running under VirtualMin - PHP code is output, not executed

I have a new webmin box with 3 servers set up on it. I've tried everything I can find online but I just cannot get PHP to execute code. The PHP content itself is simply output to the browser. I've tried this on multiple domains and they are all the same result.

I didn't do anything unusual, I just installed webmin, then php & then virtualmin, so I'm sure it is just a config issue somewhere but I cannot find it!

Any help or advice would be much appreciated.

Status: 
Active

Comments

Howdy -- it looks like you're seeing a PHP configuration issue there. That can often happen in this case here:

https://www.virtualmin.com/documentation/system/faq#toc-why-does-php--pr...

We'd be happy to help you dig into that if you like, though since you're using Virtualmin GPL you'd want to purchase a support incident for that.

Or, if you'd like to see if that can be resolved using the free community help, you can also post your question in the Forums using the Forums link above.

Thanks - I dont see any setHandler lines in /etc/httpd/conf.d. I just used yum install php to install php and I dont remember using any third party repositories.

I'll try the forums. I can't afford another support ticket! Cheers

Hi guys,

PHP seems to be not working with webmin/virtualmin in centos 7.2. I give you my details bellow, its very frustrating:

  • Centos 7.2.1511
  • Apache/2.4.6 (CentOS) OpenSSL/1.0.1e-fips mod_fcgid/2.3.9 PHP/5.4.16 configured
  • "Yum list installed" show only the 5.4.16 version of php installed
  • This command: php mytestfile.php is working

I tried to remove every php package and configrutarion in the server and install it again with this instructions "https://www.virtualmin.com/documentation/web/multiplephp#toc-installing-..."

PHP is working perfect, this is an webmin/virtualmin issue as no matters what configuration you put in php.conf and httpd.conf, it will never work...

Note: If I install apache and php separated in a virtual machine (clone of the same server) it works, but it do not work after install webmin/virtualmin.

I found the problem, it was an incompatibility with the CGI modules. To solve this you have to uninstall httpd,php and all the modules associated, remove extra repositories and install everything again.

Thanks ;)

I just installed Virtualmin.

Operating system CentOS Linux 6.9 Webmin version 1.852 Usermin version 1.720 Virtualmin version 6.00

PHP versions 5.3.3, 5.6.25, 7.0.10 Re-Check Configuration works fine.

Mode is Apachemod_php (run as Apache's user) default version 5.6.25

First this mode option was available, then, after adding virtual host - disappeared, then I installed

yum --enablerepo=centosplus install mod_php it appeared back.

Searched for SetHandler

# grep -r -i --include \*.conf SetHandler /etc
/etc/httpd/conf/httpd.conf:#    SetHandler server-status
/etc/httpd/conf/httpd.conf:#    SetHandler server-info

/index.html - ok but /i.php - outputs source code.

My httpd.conf is here https://justpaste.it/1bq1y

Restarting apache not helped.

Please help.

Welshman's picture
Submitted by Welshman on Tue, 09/26/2017 - 12:49

Well over my head ther but unborn will solve it.

For anyone seeing this issue, take a peek at this issue here if you hadn't already:

https://www.virtualmin.com/documentation/system/faq#toc-why-does-php--pr...

If that doesn't help and you're using Virtualmin GPL, my suggestion is to post a new Forum thread describing your issue. We monitor the Forums, along with lots of wonderful folks in the community!

If you're using Virtualmin Pro, my suggestion is to open up a new support request, and we'll give you a had in there.

Thanks!