1 / 5

How to Remove x powered by in Apache PHP

Sometimes you may need to remove x-powered-by header in Apache/PHP. Here is how to remove -powered-by in Apache/PHP.<br><br>Visit https://ubiq.co/tech-blog/how-to-remove-x-powered-by-in-apache-php/

Download Presentation

How to Remove x powered by in Apache PHP

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. How to Remove x-powered-by in Apache/PHP

  2. Using php.ini Open terminal and run the following command to view php.ini in a text editor. $ sudo vi /etc/php.ini Change the following expose_php = on To expose_php = off

  3. Using PHP code If you don’t have access to php.ini, just add the following to your PHP response, to remove or overwrite the x-powered-by header before sending it to the client. <?php header_remove("X-Powered-By"); ?> The following function will replace the x-powered-by header value ‘ABC’. You can change it as per your requirement. <?php header("X-Powered-By: ABC"); ?>

  4. Restart Apache web server Restart Apache web server to apply changes. # service httpd restart OR # systemctl restart httpd OR # sudo service apache2 restart

  5. Thank You Visit for details https://ubiq.co/tech-blog/how-to-remove-x-powered-by-in-apache-php/

More Related