Langsung ke konten utama

LARAVEL INSTALLING PROBLEM : LARAVEL COMMAND NOT FOUND

<span>Photo by <a href="https://unsplash.com/@glenncarstenspeters?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Glenn Carstens-Peters</a> on <a href="https://unsplash.com/s/photos/computer?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></span>
Photo by Glenn Carstens-Peters on Unsplash

When i start to migrating from Windows to Linux (i am using Ubuntu 18.04) i have to install everthing including Laravel. So i installed the Laravel globally using composer 
everything went ok. Then i found problem when i want to make a project named "perpus" using command   
The error says : "laravel : command not found". Then i checked what the official website says :
"Make sure to place Composer's system-wide vendor bin directory in your $PATH so the laravel executable can be located by your system. This directory exists in different locations based on your operating system; however, some common location inceelude : GNU / Linux Distributions : $HOME/.config/composer/vendor/bin or $HOME/.composer/vendor/bin"
So we have to check our Composer PATH location and Linux's Bash to make sure there are in the same location. First, open the terminal and type

we can see my Composer PATH located in /.composer/vendor/bin, then we must check do Bash locating the PATH in the same place by type "echo $PATH"
What written in my Bash is /.config/composer/vendor/bin, that's why laravel command not found because the PATH location between Composer's setting and Bash are different. So we have to edit PATH on the Bash to change it permanently. Actually you can use one step by export command but it's not change permanently, that's why i prefer to edit it. To start edit, open Bash file by typing : 
The editor will be appear, scroll at the last of content, and then we can find text
PATH=$PATH:$HOME/.config/composer/vendor/bin
export PATH
edit the PATH into "$HOME/.composer/vendor/bin". Save and close the editor. We need to run the current command by type 
then we can check again by type "echo $PATH" 
We can see now we have a new PATH located in /.composer/vendor/bin. But why the old PATH (/.config/composer/vendor/bin) is still there? Don't worry, it will disapear when you close the terminal and echo the PATH again.

Now we can test the laravel command by go to our web localhost directory and type laravel on the terminal
Tara! now we can use laravel command anytime

Komentar

Postingan populer dari blog ini

[SOLVED] #1558 - Column count of mysql.proc is wrong. Expected 21, found 20.

Photo by ClĂ©ment H on Unsplash When i imported a database, i got problem with the error said  After i search the solution on the internet, i found a simple solution. If you are using Xampp with MariaDB server. Here what you need to do : 1. Open terminal, go to opt/lampp/bin directory 2. Do upgrade with mysql_upgrade command. Enter the password, wait untill the upgrade is done That's it ! it works for me, now i can import my database

Otentikasi User Dengan JWT Dalam ExpressJS

 Otentikasi dilakukan untuk pengecekan agar tidak sembarang orang yang bisa mengakses fitur/ request , melainkan hanya untuk orang-orang yg sudah terdaftar/login saja. Kalau dulu dalam pengecekan ini saya mengetahuinya dengan menggunakan session , dengan alur ketika user login, data login disimpan di session store , lalu ketika user hendak mengakses suatu fitur/meminta request , server akan mengecek apakah datanya ada di dalam session store atau tidak. Kalau tidak, request -nya akan ditolak sehingga mengharusnya dia login kembali. Nah, JWT (JSON Web Token) juga mirip-mirip alur logikanya, hanya data yang digunakan untuk pengecekannya tidak menggunakan session , melainkan dengan token. Kalau digambarkan alurnya seperti ini: Disini saya menggunakan Postman sebagai simulasi client agar saya bisa fokus ke bagian pemrograman servernya (step nomor 2, 3, 6, dan 7). Lalu diasumsikan sudah terkoneksi dengan database dan sudah ada beberapa data user (password dienkripsi dengan menggunaka...

Catatan Pribadi Syarah Alfiyah Al-Iraqi (Bait 47-56)

Photo by Sincerely Media on Unsplash Pengisi : Ustadz Miftah MENGAMBIL HADIST DARI KITAB MUTAMAD BAIT 47-49 Alasan mengapa kita harus mengambil hadist dari sumber yang mu’tamad adalah karena jika kita bersandar kepada kitab yang tidak terpecaya (belum di- muqoballah dengan yang asli) bagaikan bersandar pada rawi yang wujudnya tidak ada. Orang dulu sebelum adanya percetakan, kitab dijual secara tulis tangan atau membuka jasa penyalinan kitab. Atau ketika sekarang sudah ada percetakan, lalu asal mengambil kitab, yang penting ada Shahih Bukhari/Muslim nya. Tanpa memperhatikan percetakan, perhatian kepada naskah, i’rab, syakal, atau muqabalah kepada ushul . Maka untuk mencegah hal yang seperti ini, hendaklah kita mengambil dari kitab yang sudah di- muqobalah dengan ushul . Tidak boleh orang yang tidak pakar mengambil matan Shahih Bukhari atau Shahih yang lain untuk diamalkan langsung atau dijadikan hujjah . Karena dia tidak tahu mana yang amm & khas , mana yang mujmal ...