On October 19, 2021, we have enabled single-sign-on for our Plesk Support Center to provide a seamless login/account experience. This implies that you’ll be able to use a single account across any of our web-facing properties.
If you had already registered your account at MyPlesk.com/Plesk360/Platform360 please use one for login. Otherwise please re-register it using the same email address as your existing Zendesk login (support account). It’s essential that you use the same email address on our support center to ensure that your tickets stay attached to the same account.

How to remove PHP version from the X-Powered-By HTTP header on Plesk server?

Follow

Comments

6 comments

  • Avatar
    Arvind Kumar Madhukar

    Hey !

     

    I have followed the same steps but it wasn't working, in order to accomplish the same, i have manually edit the each fpm php.ini file and reload the same.

    Example For X.X

    /opt/plesk/php/X.X/etc/php.ini

    change expose_php = On to expose_php = Off

    where X.X is my php versions.

    0
    Comment actions Permalink
  • Avatar
    Maxim Krasikov

    Hello @Arvind Kumar Madhukar,

    Both approaches are correct.
    If expose_php is set to Off directly in php.ini or included as php.d/hideheader.ini,  PHP version displaying is disabled in these cases.

    It can be checked using a query like the following:
    # /opt/plesk/php/X.X/bin/php -i | grep expose_php
    expose_php => Off => Off

    0
    Comment actions Permalink
  • Avatar
    Tobias Maffert

    Wenn ich das mit Plesk 18.0.36 mache , passiert nichts.

    Meine Schritte:

    nano /opt/plesk/php/7.4/etc/php.ini
    Ändern in:expose_php = Off
    systemctl restart plesk-php74-fpm.service

     

    0
    Comment actions Permalink
  • Avatar
    Alex Davydov

    Tobias Maffert Please let me draw your attention that, if the domains are using PHP FastCGI it is necessary to restart the Apache webserver using one of the following commands:

    • systemctl restart httpd
    • systemctl restart apache2

    In case the issue persists after that, consider submitting a ticket to Plesk technical support.

    0
    Comment actions Permalink
  • Avatar
    TomBob

    Doing it for webmail does it in files that are marked "Don't Edit". How to do it without the risk of the change being overwritten?

    0
    Comment actions Permalink
  • Avatar
    Alex Davydov

    TomBob Changes made in /etc/psa-webmail/horde/horde/php.ini or /etc/psa-webmail/roundcube/php.ini can be overwritten in case of Plesk updates. To make any changes in these files persistent, it is required to follow these steps:

    1. Create a special php.ini.tpl.local file:

      • For Roundcube: /usr/share/psa-roundcube/config/php.ini.tpl.local
      • For Horde: /etc/psa-webmail/horde/horde/php.ini.tpl.local
    2. Add the required custom change, for expose_php:

      [PHP]
      expose_php = Off

    3. Re-install Roundcube/Horde to apply changes.

    0
    Comment actions Permalink

Please sign in to leave a comment.

Have more questions? Submit a request