PHP not running as virtual server owner

I've added an additional PHP version as per the document on the site.

If I recheck setting: The following PHP versions are available : 7.0.33 (/usr/bin/php-cgi7.0), 7.3.3 (/usr/bin/php-cgi7.3), 7.0 (mod_php) No PHP-FPM packages were found on this system.

Run CGI scripts as domain owner? Yes
PHP script execution mode FCGId (run as virtual server owner)

It is using: /etc/php/7.3/apache2/php.ini rather than the one in the virtual host Also the process running is www-data

Status: 
Closed (fixed)

Comments

I should mention that I've tried changing the mode between them all and it doesn't seem to make any difference to the operating mode.

Before I did the update it was running as the virtual owner.

Howdy -- thanks for contacting us!

What is the output of this command:

find /etc/apache2 | xargs grep -i sethandler

grep: /etc/apache2: Is a directory grep: /etc/apache2/sites-enabled: Is a directory grep: /etc/apache2/suexec: Is a directory grep: /etc/apache2/conf-enabled: Is a directory /etc/apache2/conf-enabled/php7.3-fpm.conf: SetHandler "proxy:unix:/run/php/php7.3-fpm.sock|fcgi://localhost" /etc/apache2/conf-enabled/localized-error-pages.conf:# SetHandler directive in a context somewhere. Adding /etc/apache2/conf-enabled/localized-error-pages.conf:# SetHandler none grep: /etc/apache2/conf-available: Is a directory /etc/apache2/conf-available/php7.0-cgi.conf: SetHandler application/x-httpd-php /etc/apache2/conf-available/php7.0-cgi.conf: SetHandler application/x-httpd-php-source /etc/apache2/conf-available/php7.3-cgi.conf: SetHandler application/x-httpd-php /etc/apache2/conf-available/php7.3-cgi.conf: SetHandler application/x-httpd-php-source /etc/apache2/conf-available/php7.3-fpm.conf: SetHandler "proxy:unix:/run/php/php7.3-fpm.sock|fcgi://localhost" /etc/apache2/conf-available/php7.0-fpm.conf: SetHandler "proxy:unix:/run/php/php7.0-fpm.sock|fcgi://localhost" /etc/apache2/conf-available/localized-error-pages.conf:# SetHandler directive in a context somewhere. Adding /etc/apache2/conf-available/localized-error-pages.conf:# SetHandler none grep: /etc/apache2/mods-enabled: Is a directory /etc/apache2/mods-enabled/proxy_balancer.conf: # SetHandler balancer-manager /etc/apache2/mods-enabled/status.conf: SetHandler server-status /etc/apache2/mods-enabled/php7.3.conf: SetHandler application/x-httpd-php /etc/apache2/mods-enabled/php7.3.conf: SetHandler application/x-httpd-php-source grep: /etc/apache2/mods-available: Is a directory /etc/apache2/mods-available/proxy_balancer.conf: # SetHandler balancer-manager /etc/apache2/mods-available/info.conf: SetHandler server-info /etc/apache2/mods-available/status.conf: SetHandler server-status /etc/apache2/mods-available/php7.3.conf: SetHandler application/x-httpd-php /etc/apache2/mods-available/php7.3.conf: SetHandler application/x-httpd-php-source /etc/apache2/mods-available/ldap.conf: SetHandler ldap-status grep: /etc/apache2/sites-available: Is a directory

sorry about the formatting!

Ah, there we go -- look for this line in that output:

SetHandler application/x-httpd-php

Any file containing that line, edit that and comment it out.

Then, restart Apache.

After that, does it begin working properly again?

Sorry about the delay in responding. I'm not getting much further with this. Still not working properly. Regardless of the execution mode I set it to - it doesn't seem to actually change anything. phpinfo reports FPM/fcgi despite me having tried to set it to use mod_php(apache).

Can you re-run the "find" command in Comment #2 above? I'm curious what that shows now.

Also, would it be possible for you to share a link where we can see the phpinfo output?

Hi Andrey, So I've replicated the issue on another server that is not yet in production so I can do more troubleshooting in a timely fashion. Installed multiple php versions as before including 5.6.40 as this particular site is using a legacy cms yet to be updated. Here is the link to the phpinfo page:

https://productdb.nikonintra.net/ph p-info.php

PHP Version is now set to 7.3.3 but still trying to run as 5.6.40. I'd be interested to learn how this all fits together but for now here is the output

grep: /etc/apache2: Is a directory
grep: /etc/apache2/mods-enabled: Is a directory
/etc/apache2/mods-enabled/status.conf:          SetHandler server-status
/etc/apache2/mods-enabled/proxy_balancer.conf:  #          SetHandler balancer-manager
/etc/apache2/mods-enabled/php7.3.conf:#    SetHandler application/x-httpd-php
/etc/apache2/mods-enabled/php7.3.conf: #   SetHandler application/x-httpd-php-source
grep: /etc/apache2/conf-enabled: Is a directory
/etc/apache2/conf-enabled/localized-error-pages.conf:#            SetHandler directive in a <Location /> context somewhere. Adding
/etc/apache2/conf-enabled/localized-error-pages.conf:#                   SetHandler none
/etc/apache2/conf-enabled/php5.6-fpm.conf:        SetHandler "proxy:unix:/run/php/php5.6-fpm.sock|fcgi://localhost"
grep: /etc/apache2/sites-available: Is a directory
/etc/apache2/sites-available/productdb.nikonintra.net.conf:#SetHandler application/x-httpd-php
grep: /etc/apache2/conf-available: Is a directory
/etc/apache2/conf-available/php7.3-fpm.conf:        SetHandler "proxy:unix:/run/php/php7.3-fpm.sock|fcgi://localhost"
/etc/apache2/conf-available/localized-error-pages.conf:#                  SetHandler directive in a <Location /> context somewhere. Adding
/etc/apache2/conf-available/localized-error-pages.conf:#                         SetHandler none
/etc/apache2/conf-available/php7.2-cgi.conf:    SetHandler application/x-httpd-php
/etc/apache2/conf-available/php7.2-cgi.conf:    SetHandler application/x-httpd-php-source
etc/apache2/conf-available/php5.6-cgi.conf:#    SetHandler application/x-httpd-php
/etc/apache2/conf-available/php5.6-cgi.conf:    SetHandler application/x-httpd-php-source
/etc/apache2/conf-available/php7.0-cgi.conf:    SetHandler application/x-httpd-php
/etc/apache2/conf-available/php7.0-cgi.conf:    SetHandler application/x-httpd-php-source
/etc/apache2/conf-available/php5.6-fpm.conf:        SetHandler "proxy:unix:/run/php/php5.6-fpm.sock|fcgi://localhost"
/etc/apache2/conf-available/php7.0-fpm.conf:        SetHandler "proxy:unix:/run/php/php7.0-fpm.sock|fcgi://localhost"
/etc/apache2/conf-available/php7.3-cgi.conf:    SetHandler application/x-httpd-php
/etc/apache2/conf-available/php7.3-cgi.conf:    SetHandler application/x-httpd-php-source
grep: /etc/apache2/suexec: Is a directory
grep: /etc/apache2/sites-enabled: Is a directory
/etc/apache2/sites-enabled/productdb.nikonintra.net.conf:#SetHandler application/x-httpd-php
grep: /etc/apache2/mods-available: Is a directory
/etc/apache2/mods-available/php5.6.conf:#    SetHandler application/x-httpd-php
/etc/apache2/mods-available/php5.6.conf: #   SetHandler application/x-httpd-php-source
/etc/apache2/mods-available/status.conf:                SetHandler server-status
/etc/apache2/mods-available/info.conf:          SetHandler server-info
/etc/apache2/mods-available/proxy_balancer.conf:        #          SetHandler balancer-manager
/etc/apache2/mods-available/php7.2.conf:    SetHandler application/x-httpd-php
/etc/apache2/mods-available/php7.2.conf:    SetHandler application/x-httpd-php-source
/etc/apache2/mods-available/ldap.conf:  SetHandler ldap-status
/etc/apache2/mods-available/php7.3.conf:#    SetHandler application/x-httpd-php
/etc/apache2/mods-available/php7.3.conf: #   SetHandler application/x-httpd-php-source

Thanks for the additional info!

It looks like there's some lines containing the following that aren't commented out:

SetHandler application/x-httpd-php

You'd need to go through all the config files containing that exact line, and comment those out. At a glance, it looks like there's about 4 of those references.

Once you do that, can you try it again and see if that helps with the issue you're seeing?

commenting all those out didn't work but a2disconf php5.6-fpm got it working

Great, we're glad you got that working -- thanks for letting us know how you were able to resolve that!