Change php version htaccess wordpress
At some point, you might need to change the PHP version of your WordPress website, especially if you’re running on an old version.
So, in this tutorial, I’ll show you how to do that using .htaccess, which is a configuration file for servers that run on the Apache software.
Change the PHP version of your WordPress site using .htaccess
Before proceeding, back up your .htaccess file or your entire website, just to be extra safe!
Also, if you’re doing this to permanently upgrade the PHP version of your WordPress website, find out if your web host, theme, and plugins support a higher version of PHP, such as 7+.
Step 1 – Access your site’s files
Here’s how to access and edit your WordPress website’s files.
The .htaccess file should normally be in your WordPress website’s root folder –
.htaccess in cPanel
Step 2 – Edit the .htaccess file
Open the .htaccess file for editing.
If you’re in cPanel, right-click on it and select Edit or Code Edit.
Editing .htaccess in cPanel
Step 3 – Add the code and save the file
I’ll give you several handlers to add, but you should stick to PHP 7+ (7.2 currently recommended) because it’s faster and more secure!
Add one of the below handlers right above the
Change to PHP 7.3
Change to PHP 7.2
Change to PHP 7.1
Change to PHP 7.0
Change to PHP 5.6
Change to PHP 5.5
That’s a wrap
Hope you found the tutorial useful and managed to change the PHP version of your WordPress website using .htaccess!
Don’t forget to share the post to help out others!
You can quickly subscribe to my newsletter by using this link.
If you have any questions or thoughts, drop a comment or send a message via contact or Facebook page.
You can also hit the follow button on Twitter and subscribe to the YouTube channel.
My WordPress website or blog services are at your disposal!
Previously I worked through an issue where my host’s server was running PHP 7.4, but my site was not using it, by editing the .htaccess file. That worked great for a while, but then reverted back.
Upon closer examination I see the following in my .htaccess, which shows that the AddHandler is rewritten.
I’ve looked through my php.ini (which appears to show 7.4) and done some searches that reference needing to update Apache to get this fixed.
Can anyone provide some confirmation or alternatives to how to get WordPress to recognize the php version itself vs my manual edits of the .htaccess file?
The page I need help with: [log in to see the link]
Can I change PHP version in htaccess?
You can't change PHP version by . htaccess. you need to get your server updated, for PHP 5.3 or you can find another host, which serves PHP 5.3 on shared hosting.
How do I change PHP version in WordPress?
To update your WordPress site's PHP version, go to Sites and select the site you'd like to change the PHP version on. Then click on the Tools tab. Under PHP Engine click on the Modify button and select your preferred PHP version in the drop-down menu.
How do I change my PHP version?
Changing the PHP version.
Navigate to the Manage Websites page..
Click the Manage button to the right of your domain..
Under the PHP section, click the Modify icon..
Choose a version of PHP from the dropdown menu..
Scroll down and click the Change PHP Version button to save your changes..
How do I change my PHP version in WordPress cPanel?
Login to cPanel account : ... .
Scroll to the SOFTWARE section of the cPanel home screen, click Select PHP Version:.
Select the PHP version from the drop down list:.
Click Set as current to update the PHP version:.
The PHP version is now updated to the latest version or selected version:.
Return to WordPress..