Skip to content
  • Solutions
    By Role
    • For Developers
    • For Content Managers
    • For Agencies
    • For IT Admins
    • For Web Hosters
    • For Developers
    • For Content Managers
    • For Agencies
    • For IT Admins
    • For Web Hosters
    By Infrastructure
    • Overview
    • AWS
    • Microsoft Azure
    • Alibaba Cloud
    • Google Cloud Platform
    • Vultr
    • Overview
    • AWS
    • Microsoft Azure
    • Alibaba Cloud
    • Google Cloud Platform
    • Vultr
    • Digital Ocean
    • Linode
    • Upcloud
    • Oracle
    • OVH
    • Digital Ocean
    • Linode
    • Upcloud
    • Oracle
    • OVH
  • Product
    • Plesk Features
    • Plesk Editions
    • What’s new
    • Pricing
    • Roadmap
    • Lifecycle Policy
    • Extensions Catalogue
  • Pricing
  • Extensions
    Featured Extensions
    • SocialBee
    • WP Toolkit
    • Sitejet Builder for Plesk
    • SEO Toolkit
    • Joomla! Toolkit
    • Premium Email
    • Email Security
    • SocialBee
    • WP Toolkit
    • Sitejet Builder for Plesk
    • SEO Toolkit
    • Joomla! Toolkit
    • Premium Email
    • Email Security
    Bundles and packs:
    • Business and Collaboration Edition
    • WP pack
    • Hosting pack
    • Power pack
    • Language pack
    • Business and Collaboration Edition
    • WP pack
    • Hosting pack
    • Power pack
    • Language pack

    See all Extensions

  • For Partners
    • Plesk Contributor Program
    • Plesk Partner Program
    • Affiliate program
    • Plesk University
  • Help Center
    • Documentation
    • Professional Services
    • Support
    • Contact Us
    • Wiki
    • Forum
  • Plesk 360 login
  • Free Trial
  • Pricing
  • Solutions
    • By Role
      • For Developers
      • For Content Managers
      • For Agencies
      • For IT Admins
      • For Web Hosters
    • By Infrastructure
      • Overview
      • Plesk on Amazon Web Services (AWS & Lightsail)
      • Microsoft Azure
      • Alibaba Cloud
      • Google Cloud Platform
      • Vultr
      • DigitalOcean
      • Linode
      • UpCloud
      • Oracle
      • OVH
  • Products
  • Pricing
  • Extensions
    • Featured Extensions
      • SocialBee
      • WP Toolkit
      • Sitejet Builder for Plesk
      • SEO Toolkit
      • Joomla! Toolkit
      • Premium Email
      • Email Security
    • Bundles and packs:
      • Business and Collaboration Edition
      • WP pack
      • Hosting pack
      • Power pack
      • Language pack
      • See all Extensions
  • For Partners
    • Plesk Contributor Program
    • Plesk Partner Program
    • Affiliate Program
    • Plesk University
  • Help Center
    • Documentation
    • Professional Services
    • Support
    • Contact Us
    • Wiki
    • Forum
  • Plesk 360 login
  • Free Trial
  • Pricing
  • Solutions
    • By Role
      • For Developers
      • For Content Managers
      • For Agencies
      • For IT Admins
      • For Web Hosters
    • By Infrastructure
      • Overview
      • Plesk on Amazon Web Services (AWS & Lightsail)
      • Microsoft Azure
      • Alibaba Cloud
      • Google Cloud Platform
      • Vultr
      • DigitalOcean
      • Linode
      • UpCloud
      • Oracle
      • OVH
  • Products
  • Pricing
  • Extensions
    • Featured Extensions
      • SocialBee
      • WP Toolkit
      • Sitejet Builder for Plesk
      • SEO Toolkit
      • Joomla! Toolkit
      • Premium Email
      • Email Security
    • Bundles and packs:
      • Business and Collaboration Edition
      • WP pack
      • Hosting pack
      • Power pack
      • Language pack
      • See all Extensions
  • For Partners
    • Plesk Contributor Program
    • Plesk Partner Program
    • Affiliate Program
    • Plesk University
  • Help Center
    • Documentation
    • Professional Services
    • Support
    • Contact Us
    • Wiki
    • Forum
  • Plesk 360 login
  • Free Trial
Plesk 360 login
Free Trial

Knowledge Base

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

 
apachedomainsfastcgihordehttp

Question

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

Answer

For a specific website:

  1. Log in to Plesk.

  2. Navigate to Domains > example.com > PHP Settings.

  3. Put the following line to the Additional configuration directives section:

    expose_php = off

  4. Verify that the header is not shown anymore:

    # curl -sIL example.com/index.php | grep -c PHP

For all websites using a specific PHP handler:

  1. Connect to the Plesk server via SSH.

    Note: If direct SSH access to the server is not possible, contact server administrator for further assistance.

  2. Check if php.ini file for the handler contains the expose_php directive:

    # cat /opt/plesk/php/X.X/etc/php.ini | grep expose_php
    expose_php = On

    • where X.X - a PHP version, e.g. 5.6, 7.0, 7.1, etc
  3. If the directive is present (the output of the command from step 2 is the same), change expose_php = On to expose_php = Off.
    If not, create a new .ini configuration file in the appropriate PHP directory:

    # echo 'expose_php = off' > /opt/plesk/php/X.X/etc/php.d/hideheader.ini

    • where X.X - a PHP version, e.g. 5.6, 7.0, 7.1, etc
  4. Reload the Plesk PHP service configuration:

    # service plesk-phpXX-fpm reload

    • where phpXX - a PHP version, e.g. php56, php70, php71, etc.

    • If the domains are using PHP FastCGI it is necessary to restart Apache webserver:

      # systemctl restart httpd

      # systemctl restart apache2

  5. Verify that the header is not shown anymore:

    # curl -sIL example.com/index.php | grep -c PHP

For webmail:

  1. Connect to the Plesk server via SSH.

    Note: If direct SSH access to the server is not possible, contact server administrator for further assistance.

  2. In /etc/psa-webmail/horde/horde/php.ini or /etc/psa-webmail/roundcube/php.ini set expose_php parameter as below:

    expose_php = Off

  3. Restart Apache:

    # service httpd restart

  4. Verify that the header is not shown anymore:

    # curl -sIL webmail.example.com/index.php | grep PHP

Tweet
Share
Share
Email
0 Shares
Read the full article
Related Posts

Your Complete .htaccess Guide: Including .htaccess Basics and More

Read More »

NGINX vs Apache – Which Is the Best Web Server in 2024?

Read More »

PHP-FPM: The Future of PHP Handling

Read More »
Knowledge Base

Websites hosted on Plesk server are unavailable with 502 Bad Gateway: upstream sent too big header while reading response header

Read More »

WordPress websites on a Plesk server show “404 Not Found” when PHP-FPM by Nginx and Proxy Mode are used

Read More »

 Website pages based on WordPress show “404 Not Found” when PHP-FPM by Apache is used

Read More »

Roundcube/Horde webmail and websites on FastCGI are not accessible: Connection reset by peer: mod_fcgid: error reading data from FastCGI server

Read More »

Hosting Wiki

  • Server Redundancy
  • Horde
  • CGI
  • Bare Metal Server
  • PhpMyAdmin
  • phpPgAdmin
  • Oracle VM Server
  • Server Virtualization Software
  • Windows Server
  • Linux
  • PHP
  • HTTP/3
  • HTTP/2
  • Domain
  • Plesk
  • Lighttpd
  • Apache Tomcat
  • Apache
  • Web Server
  • DNS Server
  • SSH
  • Webmail
  • HTTP
X-twitter Linkedin Youtube Reddit Github
  • Product
  • Login
  • Pricing
  • Editions
  • For Partners
  • Partner Program
  • Contributor Program
  • Affiliate Program
  • Plesk University
  • Company
  • Blog
  • Careers
  • Events
  • About Plesk
  • Our Brand
  • Resources
  • User and Admin guides
  • Help Center
  • Migrate to Plesk
  • Contact Us
  • Hosting Wiki
  • Forum
  • Legal
  • Legal
  • Privacy Policy
  • Imprint

© 2025 WebPros International GmbH

Part of the WebPros®  Family