Trying to figure out how to create a php.ini file to set expose_php = off for your WordPress website with FTP or File Manager?
Shared Hosting & cPanel
The beauty of shared hosting aside from it being cost effective is that hosting companies like A2Hosting have organized most of the files you’ll need within cPanel which you can usually access easily from your hosting account. It does still take some knowledge and navigation but you aren’t having to SSH into your website with Linux or through terminal. If you have cPanel access, this may be an easier way to adjust your php setting.
SIDE NOTE: …yes my name is spam. My former domain registrar GoDaddy doesn’t believe in free privacy for customers so I registered my domain names with a spam email and google voice number. When you don’t register your domain names with whois privacy, the email and information you use to purchase your domain will be made public to bots waiting to spam you from the moment you place your order. GoDaddy charges an additional $10 for this on top of their registration fee; namecheap.com provides this for free and usually has discounts on their current offers page. I will create a separate post on how to transfer your domain name from GoDaddy to namecheap because GoDaddy hasn’t made it easy requiring you to unlock your domain. You will most likely have to message them for support where they will of course hassle you to try to keep you at GoDaddy. You do you but I own too many domains to spend $20 a year in renewals & registration fees and don’t like throwing money away.
1. Login to cPanel
2. Navigate to “Select PHP Version” in the Software Section ignoring anything else that says “PHP” in Databases. If you’re having trouble finding it, press “command+f” on your keyboard and type “php version” in the search field which should bring you right to it.
3. From the PHP Selector page, there should be an button to “Switch to PHP options“, or simply “options” in newer version of cPanel. This is located in the top right hand corner in A2Hosting.
4. Here is where you can adjust your PHP settings without having to create a php.ini file or make any changes to your .htaccess file. Simply uncheck the “expose_php” check box and you’re done!
Good luck and as always, backup your website before making changes!
