Knowledgebase

How to Set the PHP Version for a Folder in cPanel

How to Set the PHP Version for a Folder in cPanel — technical guide illustration

You can use a different PHP version for a folder than the one used by your domain by placing the appropriate PHP handler directive in that folder’s .htaccess file.

  1. Log in to cPanel and open MultiPHP Manager in the Software section.
  2. Select your domain, choose the PHP version you want from the dropdown, and click Apply. This generates the PHP handler code in your domain’s /public_html/.htaccess file. Screenshot for How to Set the PHP Version per Folder?
  3. Use cPanel File Manager or an FTP client to open /public_html/.htaccess. Locate and copy the PHP handler code. Screenshot for How to Set the PHP Version per Folder? Screenshot for How to Set the PHP Version per Folder?
  4. Create or open the .htaccess file in the folder that should use that PHP version—for example, /public_html/forum/.htaccess—and paste in the copied code.

The folder will use the PHP version specified by that handler code. To use the same version in another folder, add the code to that folder’s .htaccess file as well. To change the version, generate the appropriate code through MultiPHP Manager and update the folder’s file.

  • 0 Users Found This Useful
Was this answer helpful?
Related Articles
Copyright © 2026 Hostcupid Web Solutions Private Limited. All Rights Reserved.