但是如果它们完全一样,
我想启动我的第一个laravel项目
所以我知道有很多模拟问题, 当运行 Composer Global需要“ Laravel/Installer”
时,它可以完美地运行,没有任何问题,我会得到此响应:
Info from https://repo.packagist.org: #StandWithUkraine
Using version ^4.2 for laravel/installer
./composer.json has been updated
Running composer update laravel/installer
Loading composer repositories with package information
Updating dependencies
Nothing to modify in lock file
Installing dependencies from lock file (including require-dev)
Nothing to install, update or remove
Generating autoload files
9 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
这告诉我Laravel确实已安装但没有更新,但是当我运行命令 laravel
响应是 laravel:找不到命令
,
我已经在我的$路径中添加了作曲家。
这就是为什么我发布此问题的原因,因为我发现的所有帖子都说要将作曲家添加到您的$路径中,但是我的已经是一个问题。
PHP也安装在我的机器上
,我正在运行Linux Ubuntu 22.04 LTS
So I know there are alot of simmular issues but none if them are exactly the same,
I want to start my first laravel project but, my terminal tells me command not found,
I installed composer from the website and when I run composer I can see that it works perfectally with no issue, when running composer global require "laravel/installer"
I get this in response :
Info from https://repo.packagist.org: #StandWithUkraine
Using version ^4.2 for laravel/installer
./composer.json has been updated
Running composer update laravel/installer
Loading composer repositories with package information
Updating dependencies
Nothing to modify in lock file
Installing dependencies from lock file (including require-dev)
Nothing to install, update or remove
Generating autoload files
9 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
This tells me that laravel is indeed installed but has not updates but when I run command laravel
the response is laravel: command not found
,
I have added composer to my $PATH already.
This is why I am posting this issue because all the posts I find says to add composer to your $PATH but mine is already but its still a issue.
PHP is also installed on my machine
I am running linux Ubuntu 22.04 LTS
发布评论
评论(2)
对于想要使用Laravel命令在Ubuntu上创建项目的任何人,您应该将$路径设置为
〜/.config/.config/composer/vendor/bin
而不是〜/。 -COSER/供应商/bin
。您可以在.bashrc(或任何其他shell配置文件,例如.zshrc)中导出它,例如export path = $ home/.config/.config/composer/vendor/bin/bin:$ path
然后运行
source〜/.bashrc
(或source〜/.zshrc
)应用更改,您应该很好。For anyone who wants to use the Laravel command to create a project on Ubuntu, you should set the $PATH to
~/.config/composer/vendor/bin
instead of~/.composer/vendor/bin
. You can export it in your .bashrc (or any other shell config file, such as .zshrc) like thisexport PATH=$HOME/.config/composer/vendor/bin:$PATH
then just run
source ~/.bashrc
(orsource ~/.zshrc
) to apply the changes and you should be good to go.我将在这里写答案,以便您可以解决问题。 AS @geertjanknapen 在评论中在评论中说,如果您可以安装项目,
则必须在运行本地服务器,一旦运行本地服务器,运行
PHP Artisan服务
,然后转到 http://127.0.0.0.1.1:8000/ < /a>,您会看到Laravel的主屏幕。 (注意8000是默认端口,因此,如果您更改了它,请将其放在那里)。I'll write the answer here so you can close the question. As @geertjanknapen said in the comment if you can install your project the run
You must have a local server running also, once you have run
php artisan serve
then just go to http://127.0.0.1:8000/ and you'll see Laravel's home screen. (NOTE 8000 is the default port, so put yours there if you've changed it).