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 PHP not working under Virtualmin on centOS - PHP code is output, not executed on the new forum.
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!
I have: 1. Uncommented the line: LoadModule php5_module modules/libphp5.so in httpd.conf 2. Checked /etc/httpd/conf.d for any setHandler lines
Any help or advice would be much appreciated.
Howdy,
What is the output of these commands:
ls /etc/yum.repos.d
rpm -qa | grep php
Also, which distro/version is it that you're using there?
-Eric
Thanks for the reply!
ls /etc/yum.repos.d:
rpm -qa | grep php:
cat /etc/redhat-release:
Howdy,
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.
-Eric
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.
- I often come to the conclusion that my brain has too many tabs open. -
Failing at desktop publishing & graphic design since 1994.
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.