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




  • 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


    change expose_php = On to expose_php = Off

    where X.X is my php versions.

    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

    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


    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.

    Comment actions Permalink

Please sign in to leave a comment.

Have more questions? Submit a request