Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

maska's avatar
Level 1

Accessing local server on mobile without hosting

I am using a laravel/inertia(vue) app i needed to access the local server of my pc on mobile without hosting (both on the same network) i found that i can host it using this command sudo php artisan serve --host "local ip address" --port 8000

and changed the APP_URL variable in the env file to match the url running on the locall server , on the same machine everything works the pages are being rendered normally but when i access it from my phone i am being able to access the routes and be redirected but the page is not being rendered

0 likes
8 replies
vincent15000's avatar

The page is not being rendered ... you see something or nothing at all ?

maska's avatar
Level 1

@vincent15000 i only get a blank page. i tried returning a string "asdf" , it works i can receive and see it on my phone browser but when i render a page using inertia let us say

 return Inertia::render('Auth/Login', [
            'canResetPassword' => Route::has('password.request'),
            'status' => session('status'),
        ]);

this only works on my pc which i am serving the app from

1 like
maska's avatar
Level 1

@vincent15000 what do you mean ? can you please collaborate more to understand what is the manifest and what it is used for?

1 like
vincent15000's avatar

@maska npm run build is used to build the manifest used by the frontend.

Be sure that you don't have cached the configuration because if it's the case you need to cache once again if you modify the .env file.

1 like
aruszala's avatar
aruszala
Best Answer
Level 56

@maska make sure you update your apps .env file and set the APP_URL to the URL ( ex.: APP_URL=http://192.168.0.101:8000 ) that you'll be accessing from your phone. Then run npm run build && php artisan serve --port 8000

2 likes

Please or to participate in this conversation.