Remove the server file.
This file was deleted.
Laravel 5 will not be used php server?
While I understand Homestead is a viable option for development, there are quite a few developers out there (present party included) who have a custom LAMP environment already in place on their development machines. FWIW Artisan's serve command is quite convenient, and certainly isn't hindering other aspects of the framework's operationg, so why remove it? If anything, removing this option hinders non-Homestead Laravel beginners from reaching the all important goal of helping users see that splash page as quickly as possible, in order to build confidence that things are indeed working correctly. Just my $0.02.
Hey Taylor, thanks for quick response. I recognize Homestead or another VM is the recommended environment, but the recommended environment shouldn't necessarily be the only option when a perfectly acceptable and easy alternative (the built-in PHP server) is already available particularly for the legions of PHP developers who have a custom dev environment in place. Setting up Homestead (or another VM) is another barrier-of-entry that could be avoided by leaving the simple artisan serve option in place. I won't belabor the point further, no need to respond, thanks for the consideration. -Jason
OK so I'll belabor the point just for one more time and then I'll shut up. :-)
Certainly the option exists, but with the removal of artisan serve that option is now not so obvious to the newbie. I guess I'm looking at this from the perspective of a new Laravel user; when introducing developers to a new framework, guiding them from framework installation to having that skeleton project up-and-running in the browser is crucial, and in the case of Laravel the artisan serve command strikes me as a convenient step along the way towards reaching that goal in cases where those developers aren't using a VM (which is more common than most would imagine I'd think); one can go from installing a Laravel 5 project to executing artisan serve in seconds flat, and now that path isn't going to be as straight as it once was.
Anyway, keep up the great work. Laravel 5 is looking great so far. - Jason
This is the right move.
If you really wish to use your machines web stack, simply use PHP's built-in web server. It's just as easy to initialize:
$ php -S localhost:8000 -t public/ from the root of your Laravel project.
$ php -S localhost:8000 -t public/
@kaidesu Sure, it's easy to initialize, but why does Homestead use homestead ssh when I can use vagrant ssh? It's cleaner and makes everything feel like it's part of the Homestead environment, if you know what I mean. I just think that keeping the serve command would make everything feel as a package. I don't know if there's any going back, but that's just my 2 cents.
@kaidesu php -S localhost:8000 -t public does the trick, tnx no need to setup homestead now :)
I'm trying to upload my laravel5 app which works fine on my localhost onto the company apache server.
The server has a collection of different projects. So we go to dev.servername.com/project_name for all of our projects. How do i establish this one project as a laravel project, i've installed composer and laravel.
I'm at a loss of what to do to serve this project, the quick start guide still states php artisan serve. When i run the php -S localhost:8000 -t public @kaidesu proposed, it says that the port is already in use, as it should be.
How do I serve this project to laravel? Do i use a different port, do i have to install homestead/vagrant(getting permissions might be a bother). Overall the icky feeling in the back of my head that i'm about to screw up all of the existing hosted projects is strong.
@codesmith55 just pick any other available port
@codesmith55 This is not to be used on a server, but your local machine while you develop your application (e.g. you'd be able to access your application at http://localhost:8000). The same goes for Vagrant or Homestead. Vagrant or Homestead are not to be installed or used on your server to host your web applications.
You should be reading up on virtual hosts if you're trying to host multiple applications on your server (or use Laravel Forge).
@kaidesu Thank you that was the answer i was looking for, i didn't know what to google(not a pleasant feeling). Where should I have naturally found this information, is it on the Laravel getting started page somewhere?
No problem, we all have been there.
It's not within the Laravel documentation per say - it's simply assumed (Installation | Configuration | Homestead). While web development and server management/configuration go hand-in-hand, they are still completely different fields.
Nothing wrong with reaching out and asking questions!
@kaidesu thanks for trick!
Arrived here via screencast - https://laracasts.com/series/laravel-5-from-scratch/episodes/2 - around 04:25 mark...
Luckily there is a simple workaround php -S localhost:8000 -t public/
php -S localhost:8000 -t public/
Removing 'serve' was a very poor choice, most especially when there is specific divergence from recently posted learning videos produced by Laravel (https://laracasts.com/series/laravel-5-from-scratch/episodes/2)
It's not up to the framework (Laravel) to serve up a local server for you. This is functionality already built in to PHP that you should be utilizing for this need.
Keep in mind that Laravel 5 is still a WIP - the videos on Laracasts I'm sure will be re-done once Laravel 5 is officially released. So really, using that is a weak argument.
@kaidesu You could make the same argument about PHP; that it isn't up to a scripting language to provide you a local server. Moreover, the fact that you cite Laracasts as a "weak argument" is not only specious but quite funny. I'm not going to comment further as nothing positive will come of it.
Uh, he's right though. Laracasts is not official in any way, that the videos presented there are out of date is not of Laravel's responsibility.
Not having ./artisan serve makes the framework less friendly. You can run ./artisan and get a list of commands and the information for running the server is available to you. It's not intuitive to do php -S localhost:8000 -t public/ are you able to? Of course. What was it hurting by having it in Laravel though? rails server anyone? I'm sad to see it go and I'll probably write a package to replace it.
Please stop commenting on this. This is very annoying. Please feel free to discuss elsewhere, like on the forums.
Put this in your terminal: alias l5_serve="php -S localhost:8000 -t public/" to create an alias for you and then cd into any laravel code and just run l5_serve
alias l5_serve="php -S localhost:8000 -t public/"
Bummed at discovering artisan serve was removed, it was a handy shortcut. Agree with everyone else lamenting this above, and fail to see any of the logic rationalizing it's removal. Further, I don't see how discouraging laravelians will in any way bolster homesteading, which seems to be the express motivation.
Yes, I know how to use the built-in server. I've been using it longer than I've been using laravel.
Might as well remove artisan inspire too.
Most of my development happens against a stack I set up and maintain myself, using nginx and php-fpm or hhvm... and housing configs for a good number of frameworks beyond laravel. But I will frequently just use the built-in server for demos at meetups and such, or if I am helping someone else get going with this for the first time.