Tronadian Web Hosting logo Tronadian Web Hosting Tronadian Web Hosting logo Tronadian Web Hosting
News:
Automatic Daily Backups New Feature - SiteJet Builder
CAD
  • CAD
  • USD
  • 0
    Account
    ExtendReduce
    Home
    Domains
    Register a New Domain Transfer a Domain My Domains
    Store
    Browse All ----- Shared Hosting WordPress Hosting SSL Certificates SEO Tools Website Security Site & Server Monitoring Professional Email ----- Register a New Domain Transfer Domains to Us
    Announcements Knowledgebase Network Status Contact Us Articles
    Client Login
    Knowledgebase
    1. Portal Home
    2. Knowledgebase
    3. cPanel - Control Panel
    4. How to Set the PHP Version per Directory in cPanel
    Categories
    • SLA & Legal Policies
      2
    • Backup/Restore
      5
    • CloudLinux (cPanel)
      10
    • cPanel - Control Panel
      24
    • Databases
      11
    • DirectAdmin
      48
    • DNS - Nameservers
      6
    • Domain Management
      10
    • Email
      17
    • FAQ
      7
    • FTP
      9
    • Installing a Control Panel
      5
    • Mail Filters & SPAM
      8
    • Mobile
      11
    • Others
      3
    • PayPal
      7
    • Plesk
      47
    • Security
      10
    • SiteJet
      1
    • SiteWorx/InterWorx
      58
    • Softaculous
      69
    • SolusVM 2
      16
    • SSL
      4
    • Virtualizor
      19
    • WHM
      18
    • WordPress
      17
    Tag Cloud
    Support
    • My Support Tickets
    • Announcements
    • Knowledgebase
    • Downloads
    • Network Status
    • Open Ticket
    How to Set the PHP Version per Directory in cPanel
    Print

    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.
    cpanel-multiphp-icon.gif

    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.
    cpanel-multiphp-select-domain-full.gif

    5. First, open the /public_html/.htaccess file in the cPanel File Manager, and you will find the code generated by cPanel.
    cpanel-multiphp-version-generated.gif



    6. After you copy the code, should you wish to set the PHP to version 8.1 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.1. 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.

    Was this answer helpful?

    0 Users Found This Useful (0 Votes)

    Related Articles

    Most Popular Articles

    How to Change the PHP Version on Your Domain in cPanel

    Some software requires a different version of PHP. You can switch the PHP versions using cPanel....

    How to Reset the PHP Version to the Default Version in cPanel

    If you want to reset the PHP version to the default version, follow these instructions:1. Log in...

    How to Set the PHP Version per Domain in cPanel

    In this article, we will demonstrate how to use cPanel to set different PHP versions for...

    How to Edit or Remove a Record in cPanel

    You can edit or remove a Record in cPanel using the cPanel's DNS Zone Editor. It allows you to...

    How to Access cPanel Web Disk

    You can use the cPanel's login details to access your Web Disk. It supports various operating...

    Tronadian Web Hosting logo Tronadian Web Hosting logo

    contact@tronadian.ca
    Product
    • Web Hosting
    • WordPress Hosting
    Domains
    • Domain Checker
    • Transfer Domain
    Services
    • SSL Certificates
    • Professional Email
    • Website Security
    • SEO Tools
    Legal
    • Privacy Policy
    • Terms Of Service
    • Acceptable Usage Policy
    • Contact Us
    • Articles
    Copyright © 2026 Tronadian Web Hosting. All Rights Reserved.
    FraudLabs Pro Prevents Fraud for Digital Businesses Payments
    Loading...
    Loading...
    Choose language
    العربية
    Azerbaijani
    Català
    中文
    Hrvatski
    Čeština
    Dansk
    Nederlands
    English
    Estonian
    Persian
    Français
    Deutsch
    עברית
    Magyar
    Italiano
    Macedonian
    Norwegian
    Português
    Português
    Română
    Русский
    Español
    Svenska
    Türkçe
    Українська

    Choose Currency

    $ CAD
    $ USD

    Generate Password

    Please enter a number between 8 and 64 for the password length

    We use cookies to improve your browsing and support experience. By continuing, you agree to our Privacy Policy.