Different websites, and sometimes different folders on the same website, need different PHP versions. A modern WordPress site wants a current PHP 8 version, while an old script in a subfolder may only run on an older one. This guide shows how to change the PHP version for a whole website in cPanel, how to set a different version for one folder, and how to check compatibility before you switch.
Why the PHP version matters
- Speed: each new PHP version runs code noticeably faster than older ones.
- Security: old PHP versions no longer get security fixes.
- Compatibility: WordPress, Joomla, WooCommerce and plugins set minimum PHP versions; very old scripts may break on new PHP.
Before you change anything
- Back up the site (Softaculous backup or cPanel Backup).
- Check requirements: your CMS and main plugins list the PHP versions they support.
- Test on a staging copy if the site is important; Softaculous can create one in a few clicks.
Option 1: change the PHP version for a whole website
- Log in to cPanel.
- Open MultiPHP Manager (Software section).
- Tick the domain, choose the PHP version from the drop-down and click Apply.
On servers with CloudLinux, Select PHP Version also lets you change the version and enable PHP extensions (such as intl, imagick or zip) for your account.
Option 2: a different PHP version for one folder
Use this when a single folder, such as /forum/ or /old-app/, needs a different version from the rest of the site.
1. Log into your cPanel account.
2. In the Software section, open the app installer by clicking on the MultiPHP Manager icon.
![]()
3. Assume that we are new to this, and the first thing we will need to do is to get the code generated by cPanel.
4. Scroll down to the end of the page, select your domain from the left side, and see the PHP Version option. With a drop-down list on the right side. Select the appropriate PHP version from the drop-down menu and click the Apply button.

5. Now open the /public_html/.htaccess file in the cPanel File Manager or in your FTP client, and you will find the code generated by cPanel.

6. After you copy the code, you will wish to set the PHP version to version 7 in the folder/forum, which means you will need to create a .htaccess file in the folder /forum/ and paste the code generated in the previous step in it.
7. Congratulations, now your folder/forum uses PHP 7, and if you wish to set any other folder to use the same version of PHP as well, you will only need to copy the code from the .htaccess file and paste it into that folder.
Reset your PHP version from your main domain. If you wish to use a different PHP version on any folder, you will need to follow steps 5 and 6, generate the code, copy that code from /public_html/.htaccess and paste it into any folder where you wish to set your selected PHP version.
Check that it worked
Create a file called info.php in the folder with this line:
<?php phpinfo();
Open yourdomain/folder/info.php in your browser; the PHP version is shown at the top. Delete the file afterwards, because it shows details about your server.
If something breaks
| Symptom | Fix |
|---|---|
| White screen or 500 error | Switch back to the previous version, then update the plugin or theme that failed |
| “Requires PHP version X” message | Choose a newer PHP version for that site |
| Missing extension error (for example intl or imagick) | Enable it in Select PHP Version → Extensions |
| Old script uses removed functions | Update the script, or keep that folder on an older version while you replace it |
Frequently asked questions
Which PHP version should I use?
The newest version your CMS, theme and plugins support. Current WordPress works best on a recent PHP 8 release.
Will changing PHP affect my email?
No. The PHP version only affects websites and scripts, not email.
Can Hostnali change it for me?
Yes. Open a ticket with the domain and the version you need, and we’ll set it and check the site still works.

