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

snehakulal7's avatar

Please answer for this

Please can any one tell me how to access project from server system with different network. php artisan serve --103.228.220.84 --port (port number) I wrote like this but i am getting an error. Can any one help me to solve this?

0 likes
15 replies
snehakulal7's avatar

Failed to listen on 103.228.220.84(Reason:The required address is not valid in its context).

ajithlal's avatar

Please try this command

php artisan serve --host <your_host_address> --port <your_port>

snehakulal7's avatar

@AJITHLAL - i tried doing this with system ip with same network it was working fine.But,Not working with public ip

ajithlal's avatar

@SNEHAKULAL7 - check with the below method brother it works for me

first, you have to run the server

php artisan serve --host 0.0.0.0

Then you need to know what`s your IP address, run this command to get IP:

In windows:

ipconfig

In Linux:

hostname -I For example, my IP is: 192.168.1.68

Once you get your IP, then you have to go to this address on your mobile. Like:

192.168.1.68:8000

And that's it.

munazzil's avatar

In your .env file change DB_PORT=3306 to DB_PORT=3305 and check that means use port as 3305.

snehakulal7's avatar

@AJITHLAL - yes its works fine with the system ip.But i am asking about public ip.Anyways Thank you for the answer.

snehakulal7's avatar

@MUNAZZIL - Checked with your solution too.Still i am getting the same thing..Is there any answer?

munazzil's avatar

Have you changed config/app.php

                         'env' => env('APP_ENV', 'development') to 'env' => env('APP_ENV', 'production'),
munazzil's avatar

Can you run your console and show it here?

        ipconfig/all
munazzil's avatar

And also try this in your console.

    php artisan up

Please or to participate in this conversation.