PHP not workin in specific virtual server using the same php version as other

Hello,

I have installed virtualmin GPL on CentOS 7-2009

By default there is a PHP 5.4 version and PHP7.2 version

I upgraded the system php5.4 version to php7.4 version

I added a first virtual server and tested php with phpinfo.php file and php7.4 is working fine

I added a second virtual server and installed a wordpress site it has the same php version configured in virtualmin > server configuration > php versions

But when I browse the page it is downloading rather than displaying

I bet there is a wise person who knows it.

Thank you.

Regards

Operating system: CentOS
OS version: CentOS 7 - 2009

Question: Have you looked at your htaccess file and made sure it’s not setting php?

There is no .htaccess file in the document_root directory
There are two .htacces files in other paths but there are no directives about any .php files.
[ssurfers@servername public_html]$ find . -name *.htaccess
./stats/.htaccess
./wp-content/plugins/akismet/.htaccess

There is a .htaccess file in the directory stats
./stats/.htaccess

AuthName “domainname.cf statistics”
AuthType Basic
AuthUserFile /home/ssurfers/.stats-htpasswd
require valid-user
<Files .stats-htpasswd>
deny from all

The other .htacces files is in a wordpress plugin directory
./wp-content/plugins/akismet/.htaccess

//# Only allow direct access to specific Web-available files.
./wp-content/plugins/akismet/.htaccess

//# Apache 2.2
<IfModule !mod_authz_core.c>
Order Deny,Allow
Deny from all

//# Apache 2.4

Require all denied

//# Akismet CSS and JS
<FilesMatch “^(form.js|akismet.js|akismet.css)$”>
<IfModule !mod_authz_core.c>
Allow from all

    <IfModule mod_authz_core.c>
            Require all granted
    </IfModule>

//# Akismet images
<FilesMatch “^logo-full-2x.png$”>
<IfModule !mod_authz_core.c>
Allow from all

    <IfModule mod_authz_core.c>
            Require all granted
    </IfModule>

Hi
Please check out if /etc/php-fpm.d/ has correct configuration. Look for users/groups and port numbers to match your httpd.conf virtual host configuration.
Regards
Dimitar

Ususally the php7.4 works fine by default in both virtual servers

In Virtualmin > Server Configuration > Website Options

The php script execution mode is set to FCGId (run as virtual server owner) in both virtual servers

There is no /etc/php-fpm.d/ directory or file in my system

The only thing I found are directories for the php7.2 version

[root@servername php7.4]# find / -name php-fpm.d

find: ‘/proc/17556’: No such file or directory

/etc/opt/rh/rh-php72/php-fpm.d

/opt/rh/rh-php72/register.content/etc/opt/rh/rh-php72/php-fpm.d

Where I can find php-fpm.d of the php 7.4 version?

Sorry. I wrote /etc/php-fpm.d/ from RedHat point of view.
You can just “updatedb” and “locate php7” and you’ll get list with all folders and files that include php7 in the name.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.