Is it possible to run multiple Laravel applications at the same time?


  • | 1274 points

    I have a project that involves multiple Laravel apps. I need them to run simultaneously to test API communication between them.

    To run Laravel, I need to point Laragon to Laravel's public folder, but how do I do it for more than one instance?


  • administrators
    | 64704 points

    @komirad: Sure, why not? What is your concern?
    If you have 3 apps locate on DocumentRoot (C:\laragon\www)

    • www
      -------- app1
      -------- app2
      -------- app3

    Laragon will auto create app1.dev & app2.dev & app3.dev and you can communicate between them.

    Note:
    As I remember, there is a bug in Laravel that mis-read environment files randomly (app1 may read .env of app2,...), please check to make sure if it is fixed.


  • | 1274 points

    Strange. I am using a www folder on my desktop with my laravel project in it. When I open "localhost" I get the generic "Index of /" where it lists the folder of my project. Clicking into it just shows my laravel files (not the site in /public).

    Where I clicked directly, into laragon->www->project-name, it brings me to project-name.dev but all I see is one file listed "phpinfo.php"

    I just started using Laragon few days back, but I've always needed to set the document root to Laravel's "public" directory for it to work. From what you are saying Laragon knows when it's a Laravel project and can automatically point to the public folder, but this does not seem to be happening for me.


  • administrators
    | 64704 points

    @komirad : Auto-created virtual host is one of key features of Laragon. You should check if you accidentially turned it off:
    Go to Menu > Preferences and make sure "Auto virtual hosts" is checked.

    When it is checked, Laragon will auto created correspond entries in hosts file & Apache/Nginx Virtualhosts/server (You can check in Menu > Nginx > sites-enabled if you are using Nginx)


  • administrators
    | 64704 points

    @komirad : Btw, I have no idea about phpinfo.php. If you did not create it, I guess you are still running another WAMP/XAMPP server and caused unexpected behaviours.


  • | 1274 points

    @leokhoa I figured the problem out. I had another apache server on 127.0.0.1 and the domain generated by Laragon was pointing to it. Just need to switch off the other Apache server.

    Is it possible to have Laragon read more than one location instead of having me put all projects in document root? My other Apache server was pointed to an external drive and I don't want to move all the files over. Do I have to sym link?


  • administrators
    | 64704 points

    @komirad: Sure, you can change the DocumentRoot location in Menu > Preferences


  • administrators
    | 64704 points

    Btw, with Laragon, you can switch to another DocumentRoot just 1 click (in Menu > www > Switch Document Root).

    Moreover, you can add Nginx to Laragon and run on another port (and set Nginx's Document Root to another folder if you want Laragon to run on multi locations the same time)


  • | 1274 points

    @leokhoa: Yes, but can I have an application outside of the DocumentRoot? eg.

    1. document root -> .../www/my-project-1 -> my-project.dev
    2. other project -> ...E:/other-project -> other-project.dev

    I am thinking I need to do a symlink if there's no feature to do this now: http://www.howtogeek.com/howto/16226/complete-guide-to-symbolic-links-symlinks-on-windows-or-linux/

    Or I need to manually edit/create the vhost at sites-enabled.


  • administrators
    | 64704 points

    @komirad: Symbolic links should work. You can give it a try :)


Log in to reply
 

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