Updated guide: This article has been refreshed for current hosting environments. Control-panel labels and available features can vary slightly by account, server configuration, or software version, but the workflow below follows the current approach used on modern hosting platforms. This guide is written to help you complete How to Set the PHP Version per Directory in cPanel safely and understand what to check if the expected result does not appear.
Before you begin
- Confirm that you are working on the correct domain, account or server.
- Take a backup before changing files, databases, DNS or security settings.
- Read the full procedure before making changes that could affect an active website.
- If the article contains screenshots, use them as a visual reference, but follow the written labels because control-panel interfaces change over time.
Best practices
- Use strong, unique passwords and enable multi-factor authentication where available.
- Keep applications, themes, plugins and server-side software updated.
- Make one major change at a time so that problems are easier to identify.
- Keep a current backup before destructive or irreversible operations.
- Document important DNS, email and application settings for future migrations.
Common problems and next steps
- The option is missing: Your hosting package or account permissions may not include the feature. Contact support if you believe it should be available.
- The interface looks different: Hosting panels are updated regularly. Look for the same feature under the relevant category rather than relying only on an old screenshot.
- The change does not take effect: Save the setting, verify the result from a new browser session, and allow time for services such as DNS, SSL and email to update.
- You are unsure about a server-level change: Stop before changing advanced settings and contact support. Incorrect server, DNS, database or security settings can affect an entire website.
When to contact support
Contact support when the required feature is unavailable, a server-level service is failing, an account is locked, a restore requires privileges you do not have, or you have verified the settings but the service still does not work. When contacting support, include the domain name, the exact error message, what you changed, when the issue started, and screenshots or log output where appropriate. Do not send passwords or other authentication secrets.
Original illustrated procedure
Do you want to use different PHP versions per directory? You can do this using cPanel and the dot htaccess file.
1. Log in to your cPanel account.
2. In the Software section, click on MultiPHP Manager.![]()
3. The first thing we need to do is to get the code generated by cPanel.
4. Scroll down to the bottom of the page. Select your domain from the left side of the screen. You can view the PHP Version from the drop-down menu on the right. Please, select the appropriate PHP version from it and click on Apply.
5. First, open the /public_html/.htaccess file in the cPanel File Manager, and you will find the code generated by cPanel. 
6. After you copy the code, should you wish to set the PHP to version 8 in the directory forums, create a .htaccess file in the directory /forums/ and paste the code generated in the previous step.
7. Congratulations, now your directory forums is using PHP 8. Should you wish to set any other directory to use the same version of PHP as well, you would only need to copy the code from the .htaccess file and paste it into that directory.
Now, reset your PHP version from your primary domain. Should you wish to use a different PHP version on any directory, follow steps five and six, generate the code, copy that code from /public_html/.htaccess and paste it into the directory where you want to set the selected PHP version.