I'm working on a project in laravel and to test the site on mobile i have been running the following command:
php artisan serve --host 192.168.83.1 --port 8000
This used to work fine, and still does on my own laptop.
However it suddenly stopped working on my phone and i can't seem to figure out why.
Could their be changes i have made to my laptop that are blocking the route?
Or have i changed something in my project which does not allow for mobile devices?
Related
I'm trying to access my Laravel project APIs on my mobile phone. Since both my machine and mobile are under the same Wi-Fi, I'm trying to run the php artisan serve on my LAN like so.
php artisan serve --host=192.167.1.101
This runs fine and I do connect, but no API calls to the server go through. It doesn't even log a call.
This seems to work just fine when I use my mobile internet and hotspot my machine. But this is not convenient as my mobile internet is very limited.
I've boiled it down to be an issue with the LAN. But that's as far as my knowledge goes.
Is there anything I need to enable?
Thanks.
After months, I've finally found the solution. Turns out my Firewall was set to not trust my WiFi network (which I use for my LAN).
As soon as I added it to the trusted list, everything works!
I've installed in my remote server, via Softaculous, Laravel 8.
In order to access directly to the APP, just like when running php artisan serve in my local machine, in CPanel i defined the document root to the folder Laravel\public.
Everything works exactly as it should! I type the address (ex: myDomain.com) and the App runs perfectly...
However i don't want to being always typing php artisan serve while developing, so i tried to replicate the cpanel struture in my local machine.
To achive thar, i've created a virtualhost in XAMPP httpd-vhosts.conf pointing to the folder Laravel\public, and created the host file in windows system, like always.
When accessing the location in my local machine the first page renders perfectly, but as soon as i make a request for a new view, by example:
Route::get('/posts', function () {
return view('posts.index');
});
I get a "Not Found The requested URL was not found on this server" error! I'm sure is not a coding error because the same code runs flawlessly in remote server.
Which technique is used by cpanel to allow laravel to work directly from \public folder without necessity to initiate anything and how to replicate that in local development machine?
Well...
After much reading, backs and forwards, i believe this behavior depends on the way Apache its served by XAMPP.
So, the solution i adopted was change my local development tool to LARAGON.
Everything worked just fine with a lot of new features that don´t exist in XAMPP.
I have an odd question. I'm currently away at college and have been using some of my free time to work on some projects I have. If I run php artisan serve run on the college wifi network would people be able to go to localhost:8000 on their computers and view the website?
localhost working only on current pc but if you want share your college friend then use like that
find your current lan ip address
php artisan serve --host --port
php artisan serve --host=192.168.2.10
php artisan serve --host=192.168.2.10 --port=8000
In laravel,Port listening on localhost:8000 but it is not available other PC if you want to share your site you need to send your ip address with your friends and your website should be running on your pc then your friends can see yuor website/application using IP:8000.
Okay, so I created a Laravel 5.2 app (mylaravel). I am currently working in Ubuntu 14.04 with XAMPP for Linux 5.6.15. The app works whenever I run it using php artisan serve (afterwards it works by visiting http://localhost:8000 <-shows my login page). I can login/logout, etc. Without running the artisan serve first, visiting http://localhost/mylaravel will render my login page BUT upon trying to login it says "The localhost page isn’t working" with error code 500. What I'm doing wrong here? Thanks in advanced.
Using your xampp shell and changed to your project directory, try
php -S localhost:8888 -t public
then you should be able to access your project by using localhost:8888 in a browser
First make sure that in your XAMPP manager you have MySQL and Apache both turned on.
Second, make sure that all your databases, tables and so on are in your MySQL XAMPP instance. You can check this by using PHPMyAdmin which comes with your XAMPP install: http://localhost/phpmyadmin
If all is good and you're still getting a 500 error, check your apache logs within your XAMPP instance.
I'm doing live chat server on my laravel development, I setup everything in Digital Ocean. Setup apache2 and phpmyadmin. However, when I tried to run the
"php artisan serve"(Default port:8000)
then open up my website with IP. The server commands didn't detect anything. Fine. I try my live chat server
"php artisan chat:serve --port=8887"
with different ports. But didn't work for me, it shows blank screen without errors. Suppose shows me live chat messeger interface on my website but blank. I know something deals to my apache2 server, but I have no idea how to deals with it.
By the way, I'm using emberJS chat server and follow-up this tutorial at here
php artisan serve is intended for local development, and as such, limits itself to the local network by default. Doing php artisan serve --host 0.0.0.0 will allow it to be accessible to the public internet.
Do note that php artisan serve should never be used to serve a production site. You should be serving the live site with Apache, not Artisan.