Search code examples
phplaravelcodeignitersubdomaincpanel

use two php versions(v7.2, v5.6) without create of subdomain


I have to upgrade my website in Laravel which is using PHP 7.2 and point root directory(public_html). In root(public_html) directory I have a folder "portal" which is a separate module in Codeigniter which is using PHP 5.6

Is there any way so I can apply PHP 7.2 on root folder(public_html) and PHP 5.6 in portal folder only .

like http://www.webiste.com/ work with PHP7.2

http://www.webiste.com/portal work with PHP5.6

Thank You


Solution

  • HERE is the exact code

    Put this code in bottom of your .htaccess file in sub domain folder

    <IfModule mime_module>
         AddHandler application/x-httpd-ea-php56 .php .php5 .phtml
    </IfModule>
    

    Put this code in bottom of your .htaccess file of "public_html" folder

    <IfModule mime_module>
        AddHandler application/x-httpd-ea-php72 .php .php7 .phtml
    </IfModule>