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

Amidamaru's avatar

Install Laravel with Specific version

Hi,

I am new to Laravel.

Do you know how to install a specific version of laravel?

I want to install version 5.1.0 or 5.0 , The latest version as of this post is published is 5.1.22

The reason why I want to install a specific version is because the routings at the beginning of Sir Jeffrey Way's tutorial of Laravel 5 prompts me with an error at the beggining of the tutorial.

Thanks for your help.

0 likes
12 replies
mstnorris's avatar
Level 55

Just add it to your composer.json file or run the following:

composer create-project laravel/laravel your-project-name 5.0
6 likes
dennisvdv's avatar

I think you van use this in your terminal:

composer create-project laravel/laravel {directory} 5.1.0
1 like
bashy's avatar

It's best to debug the error and figure out that... What's the error?

Amidamaru's avatar

Hi @mstnorris

Thanks for your answer.

Do you know what will the composer.json file look like after editing it?

This is what my composer.json file in homestead looks like: { "name": "laravel/homestead", "description": "A virtual machine for web artisans.", "require": { "php": ">=5.4", "symfony/console": "~2.0", "symfony/process": "~2.0" }, "license": "MIT", "authors": [ { "name": "Taylor Otwell", "email": "taylorotwell@gmail.com" } ], "autoload": { "psr-4": { "Laravel\Homestead\": "src/" } }, "bin": [ "homestead" ] }

mstnorris's avatar

This is the wrong composer.json file. I'm talking about your project's composer.json file. The one you've shown is for the homestead box.

@redshot if you run the command I showed above to create a new project, that will create a composer.json file for you and pull in the relevant dependencies. You shouldn't need to do anything else with it, until you start adding dependencies of your own.

Anyway, what is the error you were getting, as bashy mentioned; let's get to the bottom of that rather than reverting to using an older version.

Amidamaru's avatar

Hi @mstnorris and @bashy

I think there has been a changed from https://laracasts.com/series/laravel-5-fundamentals to the current laravel files.

I'm try to access http://laravel5.dev:8000/contact

This is my static routes.php file code: Route::get('contact', 'WelcomeController@contact');

This is my WelcomeController: class WelcomeController extends Controller { public function index() { return view('welcome'); } public function contact() { return 'Contact Me'; }

}

When i access http://laravel5.dev:8000/contact in a browser. The error is: Sorry, the page you are looking for could not be found. NotFoundHttpException in RouteCollection.php line 161:

mstnorris's avatar

Have you set up your /etc/hosts file?

Below is if you're using Homestead with the default IP address

192.168.10.10   laravel5.dev

Also, take a look at some Guidelines I put together, it will help you to format your code properly while posting in the forum.

bashy's avatar

Weird how that doesn't find the contact route. If you figure out why, please post it for my saneness :)

Amidamaru's avatar

Hi @bashy

I think the version of laravel that i'm gonna use is also a factor. I'm gonna use laravel 5.0 for now to learn how things are done here in Laravel.

I also created a new folder called projects and run a manual command like : composer create-project laravel/laravel your-project-name 5.0

Amidamaru's avatar

Yeah.. I think i'm gonna search how do they do routing here

Please or to participate in this conversation.