Valet 正在运行但无法创建新的 Laravel 安装?
Valet is working but can't create a new Laravel install?
我有代客工作,我可以 ping .test 域,我什至在 "builds" 文件夹的 "test" 文件夹中有一个虚拟的 index.php hello world。
(我想将我的网站保存在 "builds" 文件夹中)
我认为它就像 cd 进入 "builds" 目录一样简单,然后我认为的命令就像 laravel new blog
和 'blog' 目录的名称一样简单为容纳新的 laravel 安装而创建。
这是我得到的错误:
laravel new blog
-bash: laravel: command not found
如果我 运行 一个 composer
命令,它表明它是可访问的,即我得到 Composer 徽标等。
哪里做错了?
知道如何解决这个问题吗?
++++
composer global show
结果如下:
Changed current directory to /Users/henry/.composer
doctrine/inflector v1.3.0 Common String Manipulations with rega...
illuminate/container v6.0.2 The Illuminate Container package.
illuminate/contracts v6.0.2 The Illuminate Contracts package.
illuminate/support v6.0.2 The Illuminate Support package.
laravel/valet v2.4.2 A more enjoyable local development ex...
mnapoli/silly 1.7.1 Silly CLI micro-framework based on Sy...
nategood/httpful 0.2.20 A Readable, Chainable, REST friendly,...
nesbot/carbon 2.24.0 A API extension for DateTime that sup...
php-di/invoker 2.0.0 Generic and extensible callable invoker
psr/container 1.0.0 Common Container Interface (PHP FIG P...
psr/simple-cache 1.0.1 Common interfaces for simple caching
symfony/console v4.3.4 Symfony Console Component
symfony/polyfill-mbstring v1.12.0 Symfony polyfill for the Mbstring ext...
symfony/polyfill-php72 v1.12.0 Symfony polyfill backporting some PHP...
symfony/polyfill-php73 v1.12.0 Symfony polyfill backporting some PHP...
symfony/process v4.3.4 Symfony Process Component
symfony/service-contracts v1.1.6 Generic abstractions related to writi...
symfony/translation v4.3.4 Symfony Translation Component
symfony/translation-contracts v1.1.6 Generic abstractions related to trans...
symfony/var-dumper v4.3.4 Symfony mechanism for exploring and d...
tightenco/collect v6.0.2 Collect - Illuminate Collections as a...
所以,我好像没有?
******** 我的 bash 配置文件是否必须位于同一目录中?我认为这可能是错误...
首先,使用 Composer 下载 Laravel 安装程序:
composer global require laravel/installer
确保将 Composer 的系统级供应商 bin 目录放入您的 $PATH 中,以便您的系统可以找到 laravel 可执行文件。根据您的操作系统,该目录存在于不同的位置;但是,一些常见位置包括:
macOS 和 GNU / Linux 发行版:$HOME/.config/composer/vendor/bin
然后你就可以执行laravel new blog
我有代客工作,我可以 ping .test 域,我什至在 "builds" 文件夹的 "test" 文件夹中有一个虚拟的 index.php hello world。
(我想将我的网站保存在 "builds" 文件夹中)
我认为它就像 cd 进入 "builds" 目录一样简单,然后我认为的命令就像 laravel new blog
和 'blog' 目录的名称一样简单为容纳新的 laravel 安装而创建。
这是我得到的错误:
laravel new blog
-bash: laravel: command not found
如果我 运行 一个 composer
命令,它表明它是可访问的,即我得到 Composer 徽标等。
哪里做错了?
知道如何解决这个问题吗?
++++
composer global show
结果如下:
Changed current directory to /Users/henry/.composer
doctrine/inflector v1.3.0 Common String Manipulations with rega...
illuminate/container v6.0.2 The Illuminate Container package.
illuminate/contracts v6.0.2 The Illuminate Contracts package.
illuminate/support v6.0.2 The Illuminate Support package.
laravel/valet v2.4.2 A more enjoyable local development ex...
mnapoli/silly 1.7.1 Silly CLI micro-framework based on Sy...
nategood/httpful 0.2.20 A Readable, Chainable, REST friendly,...
nesbot/carbon 2.24.0 A API extension for DateTime that sup...
php-di/invoker 2.0.0 Generic and extensible callable invoker
psr/container 1.0.0 Common Container Interface (PHP FIG P...
psr/simple-cache 1.0.1 Common interfaces for simple caching
symfony/console v4.3.4 Symfony Console Component
symfony/polyfill-mbstring v1.12.0 Symfony polyfill for the Mbstring ext...
symfony/polyfill-php72 v1.12.0 Symfony polyfill backporting some PHP...
symfony/polyfill-php73 v1.12.0 Symfony polyfill backporting some PHP...
symfony/process v4.3.4 Symfony Process Component
symfony/service-contracts v1.1.6 Generic abstractions related to writi...
symfony/translation v4.3.4 Symfony Translation Component
symfony/translation-contracts v1.1.6 Generic abstractions related to trans...
symfony/var-dumper v4.3.4 Symfony mechanism for exploring and d...
tightenco/collect v6.0.2 Collect - Illuminate Collections as a...
所以,我好像没有?
******** 我的 bash 配置文件是否必须位于同一目录中?我认为这可能是错误...
首先,使用 Composer 下载 Laravel 安装程序:
composer global require laravel/installer
确保将 Composer 的系统级供应商 bin 目录放入您的 $PATH 中,以便您的系统可以找到 laravel 可执行文件。根据您的操作系统,该目录存在于不同的位置;但是,一些常见位置包括:
macOS 和 GNU / Linux 发行版:$HOME/.config/composer/vendor/bin
然后你就可以执行laravel new blog