Is it possible to run multiple Laravel applications at the same time?
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?
@komirad: Sure, why not? What is your concern?
If you have 3 apps locate on DocumentRoot (C:\laragon\www)
Laragon will auto create app1.dev & app2.dev & app3.dev and you can communicate between them.
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.
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.
@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)
@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.
@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?
@komirad: Sure, you can change the DocumentRoot location in Menu > Preferences
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)
@leokhoa: Yes, but can I have an application outside of the DocumentRoot? eg.
- document root -> .../www/my-project-1 -> my-project.dev
- 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.
@komirad: Symbolic links should work. You can give it a try