Array

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

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...

Whats the difference between the Tapo P100 and the P105?

There are a few different Tapo smart plugs. The P100 and P110 differ based on the smart power monitoring feature but where does the...

4 COMMENTS

LEAVE A REPLY

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

Memory Converter

Converting values between various metric measurements is usually quite simple as there will be 1000 of the smaller unit in the next larger unit....

Bitrate Converter

Below you will find a bitrate converter. This tool will allow you to enter a bitrate value, in one of many different formats and...

Aesthetic Text Generator

There are various ways to make your social media profile seem more unique, some of which are not as easy to implement as others....

Aspect Ratio Calculator For Images

Aspect ratio is the ratio between the height and width of an image. If you want to resize an image by 100 pixels, you...

Add Text To Image

Use this free tool to add text to an image. Simply select the image file that you want to overlay text onto and you...

JavaScript Multi-line String Builder

Javascript did not always support multi-line strings. If you attempted to create a string variable using quotes, putting a line break into the source...

Latest Posts

Latest Questions