Hostxpeed
Login Get Started →
Security

How to Hide PHP Version

3 min read
24 views
Jun 10, 2026

Step 1: Edit php.ini

sudo nano /etc/php/8.1/fpm/php.ini

Find and set:

expose_php = Off

Step 2: Restart PHP-FPM

sudo systemctl restart php8.1-fpm

Step 3: Verify with curl

curl -I https://yourdomain.com | grep X-Powered-By

Should return nothing.

For Nginx + PHP-FPM

Also hide from FastCGI responses:

fastcgi_hide_header X-Powered-By;

Was this article helpful?