50 likes | 70 Views
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/
E N D
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
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"); ?>
Restart Apache web server Restart Apache web server to apply changes. # service httpd restart OR # systemctl restart httpd OR # sudo service apache2 restart
Thank You Visit for details https://ubiq.co/tech-blog/how-to-remove-x-powered-by-in-apache-php/