更新时间:2023-11-17 08:41:34
要使用composer安装Laravel,您要做的就是在终端中运行:
To install Laravel using composer, all you need to do is to run in your terminal is:
composer create-project --prefer-dist laravel/laravel blog
其中: blog
是包含新Laravel实例的文件夹的名称.
Where: blog
is the name of the folder containing your new Laravel instance.
要直接在您选择的目录中安装Laravel(而不是如上所示,在其中的文件夹中),只需运行相同的命令,但是这次不带文件夹名称,如下所示:
To install Laravel directly within your chosen directory (not in a folder within it as demonstrated above), simply run the same command but this time without a folder name as in:
composer create-project --prefer-dist laravel/laravel
记住要在项目所需目录中运行命令;对于您的情况,对于 C:\ xampp \ htdocs \
,然后根据需要运行上述第一个或第二个命令.
Remember to run the command within your desired directory for the project; in your case, for C:\xampp\htdocs\
, then, run either the first or second command as above base on your needs.
这假定您已经按照建议在其网站上正确安装了Composer.>
This assumes you already have Composer properly installed as recommended on their website.
在尝试解决无法打开流的错误之前,请避免使用上面命令中的文件夹名称带有空格(显然不是错误的根源).
Before you try addressing your failed to open stream:
error, do avoid having folder names with space(s) as in your command above (obviously not the source of the error).
确保您具有正确的Laravel服务器要求
无法打开流:
错误通常在未启用OpenSSL PHP扩展时发生.
Make sure you have the correct Server Requirements for Laravel
the failed to open stream:
error usually occur when the OpenSSL PHP Extension not enabled.
启用所需的扩展名后,请务必记住重新启动服务器,然后运行以下命令:
After enabling the required extension(s), do remember to restart your server, then run the following command:
composer update