如何在 Windows 上通过 Laravel Installer 安装 Laravel?

编程入门 行业动态 更新时间:2024-10-26 06:25:19
本文介绍了如何在 Windows 上通过 Laravel Installer 安装 Laravel?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在尝试使用 Laravel Installer 方法在 Windows 上安装 Laravel 框架.

I’m trying to install the Laravel Framework on Windows with the Laravel Installer method.

在文档中我发现了以下内容:

In the documentation I found the following:

首先,使用 Composer 下载 Laravel 安装程序.确保将~/poser/vendor/bin"目录放在你的 PATH 中,这样laravel 可执行文件是在你运行 laravel 命令时找到的终端.

First, download the Laravel installer using Composer. Make sure to place the "~/poser/vendor/bin" directory in your PATH so the laravel executable is found when you run the laravel command in your terminal.

现在这个 PATH 对我来说并不熟悉.你能告诉我Windows的工作路径吗?

Now this PATH does not look familiar to me. Could you tell me the working path for Windows?

顺便说一句:我正在使用 WAMP.Composer 已安装并更新.

推荐答案

Windows 的 PATH:

我找到了 composer 存储 Vendor 文件的位置.

The PATH for Windows:

I’ve found the location where composer stores the Vendor files.

因此,在 Windows 上应使用以下路径,而不是 ~/poser/vendor/bin:

So instead of ~/poser/vendor/bin, on Windows the following path should be used:

C:Users<COMPUTER NAME>AppDataRoamingComposervendorin

如何安装 Laravel 安装程序:=======

我假设你的 PATH 中已经有 php 和 composer.

How to install the Laravel Installer: =======

I assume you have php and composer in your PATH already.

首先安装 Laravel Installer. 打开命令提示符并输入:

First of all install the Laravel Installer. Open a command prompt and enter:

composer global require "laravel/installer=~1.1"

**然后通过例如更新 PATH 环境变量**具有管理员权限的命令提示符:

**Then update the PATH environment variable** via e.g. command prompt with admin privileges:

set PATH=%PATH%;%USERPROFILE%AppDataRoamingComposervendorin // setx /M path "%path%;%appdata%Composervendorin" (this may destroy your system)

%appdata% 已添加,因此您无需担心添加计算机名称.如何创建一个全新的 Laravel 安装:

现在你应该可以在命令提示符下运行 laravel 命令了.

%appdata% is added, so you don’t have to worry about adding your computer name. How to create a fresh Laravel Installation:

Now you should be able to run laravel commands in the command prompt.

要创建全新的 laravel 安装,请在选择的目录中打开命令提示符并输入:

To create a fresh laravel installation, open a command prompt in the directory of choice and enter:

laravel new name_of_directory

如果一切正常,您应该会看到以下消息:

If everything went right, you should see the following message:

制作应用程序...申请准备好了!打造令人惊叹的东西.

Crafting application... Application ready! Build something amazing.

更多推荐

如何在 Windows 上通过 Laravel Installer 安装 Laravel?

本文发布于:2023-11-06 13:26:41,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1563808.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何在   Windows   Installer   Laravel

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!