How To Add Laravel Directory To Your PATH file

Installing Laravel is a simple setup, but it seems like a lot of simple things also go wrong and if you don’t know how to handle them it can get quite difficult to figure out what is the cause and how to fix it. One of the most common errors you are going to come across is “Laravel: command not found”. There is no need to worry! This error is common even if you have installed everything correctly. Nothing is actually wrong just a small quick fix.

On the official tutorial for Laravel, you will come across the following message that throws quite a few people off.
“Make sure to place the ~/.composer/vendor/bin directory in your PATH so the Laravel executable is found when you run the Laravel command in your terminal.” This means place the location of Laravel to your PATH file so that you can use the Laravel command. If you don’t do this you will see the following when you run a Laravel command.

Laravel --version
-bash: Laravel: command not found

I’m going to assume that you have used composer to install Laravel. If not then you will need to update the path below to the location of Laravel on your system. Everything else will remain the same. So the issue here is that the PATH file does not know where Laravel is installed. All you have to do is update PATH so that it knows where Laravel is.

I’m going to break this down a bit just in case you haven’t used composer to install Laravel. $PATH: contains the current contents of the PATH file. This is required so you don’t overwrite the current contents of the PATH. The content after PATH is the location of Laravel. If you use composer it is most likely installed in your users directory. e.g. “/root/.composer/vendor/bin”. You can change the directory to whatever directory you have Laravel installed to. The code below should work if you installed Laravel with composer.

export PATH="$PATH:~/.composer/vendor/bin"

You should now be able to use Laravel commands regardless of your working directory. To test if this is working, retry the following command.

Laravel --version
Laravel Installer version 1.1

Related Articles

Related Questions

WordPress Table of Contents Plus Not Working

I have been using this plugin for a while and i really like it. It seems to have completely stopped working recently. I can...

Function Keys Reversing Between Fn Actions And Normal

My keyboard has the usual F1 to F12 keys along the top. I use these for shortcuts in various applications. These keys also have...

Whirlpool Oven F6E6: Appliance Manager 1 Board Communication

I have a brand new Whirlpool oven W11I OM1 4MS2 H or (859991549450). I bought it alongside the microwave combi oven. I have had...



Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Latest Tools

Markdown To Html Converter

Welcome to our web-based tool designed to make your life easier by converting Markdown to HTML in a matter of seconds. Our user-friendly interface...

AI Content Detector

We've got this awesome free tool that'll help you figure out if that content you're looking at was written by a human or some...

Image Saturation

Are you looking for an easy-to-use, free app to modify your image saturation levels and make your pictures truly pop? Look no further! Our...

Pixelate Image Tool

Introducing the ultimate free online image pixelator tool that allows you to easily transform your images into stunning pixel art in just a few...

Image RGB Level Adjustment Tool

Introducing the ultimate image color adjustment tool for all your photo editing needs. Our free online tool lets you take full control of your...

Image Color Inverter

Looking for a quick and efficient way to convert your images into negatives? Our Free Image to Negative Converter is the answer! Our online...

Latest Posts

Latest Questions