> For the complete documentation index, see [llms.txt](https://docs.clouduxe.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.clouduxe.com/cpanel-control-panel/how-to-set-the-php-version-per-directory-in-cpanel.md).

# How to Set the PHP Version per Directory in cPanel

## How to Set the PHP Version per Directory in cPanel

If you want to use different PHP versions for specific directories, cPanel makes this easy using the `.htaccess` file.

### Steps to Set PHP Version per Directory:

* Log in to your cPanel account.
* In the **Software** section, click on **MultiPHP Manager**.

<figure><img src="/files/K5TcYifVNcA3QHm62kzy" alt=""><figcaption></figcaption></figure>

* Scroll down to the bottom of the page. Select your domain from the left side.
* Choose the desired PHP version from the drop-down menu and click on **Apply**.

<figure><img src="/files/eDz3uLcXuTcKePYH3sHR" alt=""><figcaption></figcaption></figure>

* Open the <mark style="color:orange;">`/public_html/.htaccess`</mark> file in the cPanel File Manager. You will find the code generated by cPanel.

<figure><img src="/files/zNUeLHEgkNPCqxo8Auei" alt=""><figcaption></figcaption></figure>

* To set PHP 8 in the directory `forums`, create a `.htaccess` file in the `/forums/` directory and paste the code generated in the previous step.
* **Congratulations!** Your `forums` directory is now using PHP 8. To apply the same PHP version to other directories, simply copy the code from the `.htaccess` file and paste it into the new directory.
