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 during installation, I just installed webmin, then php, proftpd, etc with yum & then virtualmin, so I’m sure it is just a config issue somewhere but I cannot find it!
- Uncommented the line: LoadModule php5_module modules/libphp5.so in httpd.conf
- Checked /etc/httpd/conf.d for any setHandler lines
Any help or advice would be much appreciated.
What is the output of these commands:
rpm -qa | grep php
Also, which distro/version is it that you’re using there?
Thanks for the reply!
rpm -qa | grep php:
CentOS Linux release 7.2.1511 (Core)
Yeah it looks like you have some non-standard PHP versions installed there.
Most likely one of them came with a config file that’s causing the problems you’re seeing now.
The key would be to find the PHP config files associated with those third party PHP versions, and then determine what about those configs are causing the issue you’re seeing. Chances are that it’s related to a SetHandler line, but it could also be something else.
It could be many things, a lot of repos there and i can bet all of them enabled what should never happen, then OP installed separately Webmin, LAMP… Virtualmin what is another mistake as Webmin/Virtualmin should be installed on clean OS.
@cron: I would scrap that server and make fresh OS and Virtualmin install. Once done you can install additional PHP versions. Keep additional repos always disabled and enable only to update specific software but you must know what, e.g. installing and updating fail2ban from EPEL is ok but if you update ClamAV it will break it, and so on.
For the repos EPEL is pretty safe to use if you know how to use it and for what and SCL if you want additional software like PHP 5.5 or 5.6 (7 still not supported). For other repos is hit or miss if you dont know what are you doing and even then its always a risk to use them. Usually they work fine but one mistake could crash your entire server.
Thanks Eric, I couldnt find anything so I ended up removing all repositories and installing new ones, then reinstalling apache,php,ssl and it worked! Glad to have it sorted at last.