Using Windows 7.
I am following Laracasts - Laravel Setup for Newbs https://laracasts.com/lessons/laravel-installation-for-newbs but when it comes to the 4:25 mark where i enter php artisan serve I get the following showing up.
C:\Users\Pierce\Desktop\laravel-demo>php artisan serve
Laravel development server started on http://localhost:8000
[Wed Mar 19 00:29:46 2014] Failed to listen on localhost:8000 <reason: An attempt was made to access a socket in a way forbidden by its access permissions.>
I have XAMPP installed straight from the box and followed the instructions in the video. What happens that I get stopped here?
you can use another port, something like this
php artisan serve --port="8888"
this port work fine for me.
php artisan serve is a command to fire up PHP's own web server. If you are using XAMPP already, I would suggest using it's built-in Apache web server and then run Laravel through that. There are plenty of documents online on how to setup XAMPP.
As for your error, it's Windows UAC that is blocking it. Disable UAC or set or exception for your program.
Buy a mac
Else
Delete XAMPP
Install Laragon (http://laragon.org/)
All problems solved!!!
I suggest you avoid using htdocs folder of xampp. Because in this method, I could not route to other pages. So you should do this, php artisan serve --port="8888" or other port (as mininoz said).
Related
I face this error only when "php artisan serve" command is not running. If this command is running then there is no such a error, but as i closed command prompt this error occurs. i have also changed port but no vain.
Kindly help me.I would like to mention here that I'm using Window 10 OS.
Thanks in advance.
If you don't have a HTTP server (like WAMP or similar installed), you'll need to keep the Command Prompt / Terminal window running at all times. Closing the window or stopping the php artisan server command will terminate the server that's running the website.
If you want a persistent server, you should look into server software like WAMP or XAMPP.
Note that this is expected behavior for the php artisan serve command.
because with this kind of server (like: LARAGON), running 'php artisan serve' is necessary, so if you close the terminal, 'php artisan serve' will automaticaly stop running, then the server will stop too, then you can't reach anymore your localhost.
If you want a persistent server, you should look into server software like WAMP or XAMPP.
Note that this is expected behavior for the
php artisan serve command
I have a fresh installed laravel app and when i run php artisan serve it shows me the server information but when i go to that server it gives a cant be reach error. I am not running Vagrant just MAMP but it used to work before. I did tried to install Vagrant in the past and it didn't work that is why i came back to MAMP only. I read something about generating a key with php artisan key:generate which didn't work. Any help is appreciated.
This is the command I am using and the result
$ php artisan serve
Laravel development server started: <http://127.0.0.1:8000>
try to uninstall the antivirus if you have one ,in my case i uninstall avast ,reboot OS and it works for me .
I am using windows 10 and wamp server and I am fresh installing laravel and all i get is this error message and is it necessary to do php artisan serve everytime i open laravel ? as long as i close cmd prompt localhost:8000 refused to connect .
Php artisan serve error
I think you are running a Laravel project blog by command php artisan serve and you are browsing your application by localhost:8000 or 127.0.0.1:8000
Your screenshot saying that when you are trying to visit a url which is not defined in your routes/web.php then, you are getting invalid request (Unexpected EOF) error in your cmd.
And of course! in this case when you close cmd then your Laravel app will not run.
So now, if you don't want to run your Laravel app by the following command each time, then you can use Laragon in windows environment.
Either you have to run php aritsan serve or set up a virtual host in your OS. Here is how to set up a virtual host in Ubuntu 16.04: How To Set Up Apache Virtual Hosts on Ubuntu 16.04
This is case, you can keep your cmd open. And open another cmd, redirect to file path where you are working and it should work fine.
I know this might sound really silly, but I'm kinda stuck and need help. I'm trying to use Laravel 5.3 and use Homestead as my IDE. I have previously worked on PHP using NetBeans and XAMPP, but the installation has always been a pain. I have no formal training and have learnt and used basic PHP on my own for my webpages.
I'm running a Windows 8-32Bit OS & here's what I've done so far:
I have downloaded Laravel using Composer.
I have installed Virtual Box & Vagrant.
I have installed Git Bash and ran vagrant box add laravel/homestead (Homestead.yaml was not found in my Homestead folder after running bash init.sh command. I downloaded it from Github and added there).
Set SSH Key.
Ran vagrant up in Homestead folder (the installation was complete).
Issues:
If I just type http://localhost:8000 in my browser, nothing happens. I have to run php artisan serve in the command prompt inside laravel directory and keep the prompt window open for the default Laravel 5 page to open.
If I type http://127.0.0.1:8000 in my browser, nothing happens at all.
So how do I use Homestead then for my development everyday ?
you can try
localhost/project-name/public
if you dont want to run php artisan serve
For previous versions of Laravel, you can simply download laravel with composer in the root folder of your apache server and type in http://localhost/public/ to see the "You've arrived" homepage.
I know I can use php artisan serve to view the Laravel5 default home page, but it is run on localhost:8000 and I heard that php artisan serve command should not be used in production due to the limit of connection and the bad performance. Is there a way I can see the default home page without using the php artisan serve command?
And it is really frustrating that Laravel is not including such simple thing in their installation documentation....
To run the service on another port you need to pass the port parameter with port numberusing this code on the cmd:
php artisan serve --port=80
To run on port 80, you might need administrator permission.
You may have to use sudo command for admin rights.
sudo php artisan serve --port=80