how to have an older php version in a single project directory

  • | 1675 points

    How would we go about installing a second (older) version of PHP along side our current version 7.4.x We need PHP 5.6 but only for a single project. How can i install this older version for just a single project directory? I've seen this feature in CPanel in shared hosting environments and its as simple as clicking a radio buttton. Any ideas??

  • | 168 points

    you can install as many php versions as you want and than simply change the versions. I'm attaching two images, first one is showing the path where you have to put the PHP versions (you have to just download a PHP version and put it there), and the other is how to change the version. After choosing a different version you have to restart laragon. Hope that helps. Cheers! !!0_1630996813563_path.png 0_1630996818974_php_versions.png

  • | 1675 points

    @mostix - i'm already doing that; that's not the issue - the way your talking about means the entire installation uses whichever php version you've switched to - i want to have php 5.6 (for example) active in a single project directory and php 7.4.1 active across the rest of laragon. Switching to an older version globally messes up too many up-to-date scripts and of course older legacy script that don't support php 7.x create error after error.

    Leo suggests it can be done by having several installations of Laragon side by side but surely that's madness unless im missing something? So 5 versions of php = 5 instances of Laragon running in separate threads??

    I don't believe its supported judging by other users who have asked about this same feature

  • administrators
    | 132054 points

    @trepatk: I wonder why do you have 5 different versions of PHP, why not upgrade to just a few.
    If you have a complex requirements, so it comes with complex solutions. Therefore, the easiest solution is limiting PHP version support :)

  • | 1675 points

    @leokhoa - not sure what you mean i dont have 5 installations; i was just surmising the solution you offered.

    To keep it on topic - How can i have 2 (at most) versions of php on my dev machine with Laragon; one old version 5.x operating on ONE project folder in www. The rest of my Laragon projects in www should use php 7.4.x. Is this possible??

    If not available could you add it as a much needed feature in future versions Leokhoa?

  • | 16270 points

    @trepatk yes, if you want to keep PHP5.6 and PHP7+ projects separate you can download Laragon portable, extract the zip. Copy your PHP5.6 project, PHP 5.6 and VC11 compatible version of Apache to your portable version. When you want to develop your PHP 5.6 project, start the probable version, when you are working on PHP7+ stop your probable version and start your full version.

Log in to reply

Looks like your connection to Laragon was lost, please wait while we try to reconnect.