问题
I am trying to install Dusk on Laravel at a REMOTE host and at some point I need to change the .env file like this
APP_URL=http://localhost:8000
Another tutorial suggested something like
APP_URL=http://localhost:9515
For a remote host, do I need to put "http://localhost:????" and if I need how do I find the port number? I not do I just leave it as "/"?
By the way, I have tested several options and non have worked so far so but I am not sure what causes it so I am trying to pint point the problem.
回答1:
Set the APP_URL
to the same URL you are using in the browser for your local development environment. This can be http://localhost
but also a custom URL:
APP_URL=http://dusk.local
For Laravel Homestead you can manage your sites within your Homestead.yaml
file.
The APP_URL
is somehow important as commands from the terminal require this information as pointed out in detail in this answer.
The port 9515
is the default port number of the Selenium server URL as provided in DuskTestCase.php
. There's no need to change it at the beginning as it should work out of the box.
By default, the ports are forwarded to your Homestead environment.
来源:https://stackoverflow.com/questions/45306147/laravel-dusk-the-correct-localhost-port-for-app-url-on-a-remote-server