Php not working

I tried this process with “CentOS 7 server” and “Centos 7 Minimal”.

I am creating a virtual server. But php files are not working. Instead, php files are starting to download directly.

For example: I write “<? Php phpinfo ();?>” To test.php file. When I open, the test.php file is not working and is downloaded to my computer.

Centosa did not have any intervention. I just installed original virtualmin.

How can I solve this problem?

Dear Masters Thank you very much already.

I’m not seeing this behavior on my CentOS 7 test system.

What PHP execution mode are you using?

I have never messed with PHP execution modes. I do not know where such a setting is made. I did not set it on another setting. All I do is install CentOS7 and then install VirtualMin. So I simply created a virtual server. But php did not work.

I have installed VirtualMin too many times before. I have never encountered such a problem. I think it’s a problem in VirtualMin.

OK, I have been able to reproduce this. mod_fcgid isn’t working right for some reason. php-fpm works, and the other execution modes work, but fcgid isn’t attaching handlers correctly it seems. I’m looking into it.

OK, here’s how you fix that:

Edit /etc/httpd/conf.d/php.conf and comment out (put a # in front of it) everything that isn’t commented out. Especially this line:

AddType text/html .php

Then restart Apache with:

# systemctl restart httpd

I’ll fix this in the installer soon. I don’t know what changed in CentOS 7 that made our installer stop working for this…

I’m going to try this right away. If it does not work, is it possible to help me by connecting remotely?

I did what you said. But it did not work. Unfortunately,

I did what you said. But it did not work. Unfortunately, :frowning:

I wondered, and I set up at CentOS 6. Virtualmin worked without problems. However, installing CentOS 7 with VirtualM will cause problems.

I’ve done a lot of testing and tried everything I wrote on the forums. But CentOS 7 and VirtualMin are not running. I think there are problems in the latest version of VirtualMin

These are the tests I did.

Stop re-installing! This is a minor, super tiny, not even significant, configuration issue. It’s almost certainly one single configuration directive that’s causing the problem (the one I mentioned above).

Are you sure you commented everything out in that file and restarted Apache? On my test machine, that was exactly the cause of the problem.

The only other cause I can think of is if there are php_admin_value options in /etc/httpd/conf/httpd.conf. Check that file for those, and remove them, if they appear.

Also, try switching execution types in Server Configuration->Website Options->PHP script execution mode.

In my testing, even when fcgid didn’t work, php-fpm did (and that was with the misconfiguration of mod_php still being in place).

edit /etc/httpd/conf.d/php.conf

SetHandler application/x-httpd-php I have changed the above lines as follows # # SetHandler application/x-httpd-php #

In doing so, it worked
I hope there are no other mistakes.
Thank you very much to joe master.