1 year ago

How to access laravel site from another computer

Posted 1 year ago by konrms

Hello guys.

I need some help on how to access my site running on my pc from another device in case the other device belongs: (1) to the same LAN and (2) outside LAN.

I am using XAMPP Apache server. On my pc I simply browse to page laravel.site and fully access my site.

  • What I have done so far and partially works for LAN case:

At cmd I ran c:\xampp\htdocs\laravel\php artisan serve --host --port 5000, (where is my local ip address). In this case, when browsing to from other local pc I can see my site's first page. But when clicking on site links I get a dns error. I can only indirectly access other site routes with[route]

For your info, my C:\Windows\System32\drivers\etc\hosts file line regarding laravel is:   laravel.site

and my C:\xampp\apache\conf\extra\httpd-vhosts excerpt for laravel is the following:

# VirtualHost for LARAVEL.DEV
<VirtualHost laravel.site:80>
  DocumentRoot "C:\xampp\htdocs\laravel\public"
  ServerAdmin laravel.site
  <Directory "C:\xampp\htdocs\laravel">
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted

Please sign in or create an account to participate in this conversation.