Laravel error in installation

Asked

Viewed 1,319 times

4

Guys, I am using mac and trying to install Laravel. I have already installed the composer, surround the command line documented in the framework :

composer global require "laravel/installer=~1.1"

He runs everything ok, but when I try

laravel new blog

It gives that the command Laravel does not exist.

I’m creating inside the xammp htdocs.

How could I fix this ?

Thank you

  • 2

    The command would not be, php laravel new blog?

  • friend of unknown command

  • This using windows or linux?

  • MAC but I believe it is similar to linux

  • It can’t be via Composer ?

  • So I’m following a book, and it uses the direct command in the Standard ... You don’t know how I can Tidy up >

  • So, but Laravel is installed via Composer. You installed Composer ?

  • yes, I have installed the Composer all right, now to the Standard using this site : https://blog.butecopensource.org/tutorial-laravel-5/ but qnd localhost access/teste1/public error 500

  • I used the search engine inside the xampp with . bash_profile and returned me two files but none with that name

  • 1

    Dude, erase that Shampoo. And install the Mamp. https://www.mamp.info/en/downloads/

  • ok I’m installing

  • worked amigoooooo finally.... S'o a question, how can I create a shortcut on the terminal ? example every time go to use cd /xxx/xxx/xxxx would like to turn this command into a goDevWeb

  • I don’t know about this, man. But good that it worked. Ask a question again. I’m sure someone should know here.

  • ok thanks for the help and patience XD

Show 9 more comments

2 answers

2


You need to have the /Users/seu-nome-de-usuario/.composer/vendor/bin in your Path so that the Executable can be used in any system folder.

To check if your path contains the path of the Composer run the command

echo $PATH

and see the output

If not, you can add the path with the command

sudo vim /etc/paths

And add to the last line

/Users/seu-nome-de-usuario/.composer/vendor/bin

or if you overwrite the paths in your terminal settings you can use

sudo vim ~/.zshrc

and add the line

export PATH="${PATH}:/Users/seu-nome-de-usuario/.composer/vendor/bin"
  • friend edited the file and put it in the last line, but no results qnd use $PATH it does not show me the path, the result is : /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

  • A tip Alan, if you do not use the @AugustoFurlan in the comment he will not receive your message, maybe he has not read your comment.

  • @augustoFurlan see if you can edit the file ~/.bashrc and add export PATH="${PATH}:/Users/seu-nome-de-usuario/.composer/vendor/bin" at the end of the file. > Remember to exchange your-username by your username

1

In the xamp I was able to solve this problem like this:

Open your .bash_profile:

vim ~/.bash_profile

And copy the following line at the end of the file:

export PATH="/Applications/XAMPP/xamppfiles/bin:$PATH"

Save, and then reboot like this:

source ~/.bash_profile

Anything try to create your projects like this:

composer create-project laravel/laravel --prefer-dist

It’s the same thing laravel new project.

  • friend went editing . bash and went wrong, can not find the file

  • search all your folders by xampp folder, then take the full address to the bin and change it to the correct address.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.