Remotely access Laravel project

2

Hello, I do not know how to access my project echo in laravel from another computer in the network, locally I can access it with:

http://localhost:8000

Now I try to access by replacing localhost with IP on the same computer on which I have the project

192.168.1.3:8000 

and does not access only works with the localhost , I guess that is the reason why I can not access from another computer on the network, if the same computer does not connect through the ip . a greeting.

    
asked by jeancarlos733 04.10.2016 в 19:27
source

2 answers

4

Steps to follow so that your PHP application is installed on the local network.

  • Define the IP , in this case you have 192.168.1.3
  • Open the file httpd.conf with block of notes, it is located at: XAMPP>apache>conf>httpd.conf
  • Find Listen 80 , something like this: #Listen 0.0.0.0:80 / 12.34.56.78:80
  • Change that IP to the IP you have in point 1.
  • Save the file httpd.conf verifying that the server points #Listen 192.168.1.3:80
  • In all your application that you make use of a variable of localhost , replace it with the IP of the server that we defined in point 1.
  • Now, if you have the firewall enabled, you must add an exception to port 80 and 8080 of the protocol http

      

    Control Panel> Windows Firewall> Allow a program to communicate through windows firewall> Add another program Name: http Port: 80 Add one more as http - 8080

    On the other hand, if you're looking for a temporary and simple testing environment, I recommend you use: Cloud9

    You can generate a temporary url of your project that will be visible until the service is turned off and you have to start it again.

        
    answered by 04.10.2016 / 20:12
    source
    1

    Only add your ip parameter when lifting the server , so that it looks like this:

    php artisan serve --host="tu ip"
    

    is fine but it would be without the "="

        
    answered by 08.02.2018 в 18:59