[英]Laravel 4.1 installation with composer in xampp
I wanted to try out the Laravel 4.1
but unfortunately got stuck at the very beginning. 我想试试
Laravel 4.1
但不幸的是在开始时卡住了。 When i try to install it using composer
as mentioned in the Laravel 4.1 documentation
, i get the following error
while running "composer create-project laravel/laravel laravelProject --prefer-dist":
当我尝试使用安装它
composer
作为中提到Laravel 4.1 documentation
,我碰到下面的error
,同时运行"composer create-project laravel/laravel laravelProject --prefer-dist":
[Composer\\Downloader\\TransportException]
The " http://packagist.org/p/illuminate/filesystem $a5912ddb14272c0efa16e821a25bb68e39d3bac736aee7de62cb5641fd7133e3.json" file could not be downloaded: failed to open stream: HTTP
request failed! [Composer\\Downloader\\TransportException]
无法下载“ http://packagist.org/p/illuminate/filesystem $ a5912ddb14272c0efa16e821a25bb68e39d3bac736aee7de62cb5641fd7133e3.json”文件:无法打开流: HTTP
请求失败!
Four simple steps to install laravel on windows machine: 在Windows机器上安装laravel的四个简单步骤:
Few steps to install for Windows Xampp, 为Windows Xampp安装的步骤很少,
Hope this will help. 希望这会有所帮助。
Go to: https://github.com/laravel/laravel 请访问: https : //github.com/laravel/laravel
Click on download in the right side of the page, unzip the file and move everything to the folder that will run the website. 单击页面右侧的下载,解压缩文件并将所有内容移动到将运行网站的文件夹。 Use the installation notes to be sure to create a public_html directory, this is where you have to publish css and javascript files.
使用安装说明确保创建一个public_html目录,这是您必须发布css和javascript文件的地方。
Another method consists into the installation of Composer: 另一种方法是安装Composer:
http://getcomposer.org/doc/00-intro.md#installation-windows
And then run this command from the prompt of commands (cmd.exe): 然后从命令提示符(cmd.exe)运行此命令:
composer create-project laravel/laravel --prefer-dist .
Where the dot is the path in which you want to install the framework. 点是您要安装框架的路径。
or simply follow the below step: Forcing composer to use https connections to Packagist Been having problems with composer from behind a company firewall. 或者只需按照以下步骤操作:强制作曲家使用https连接到Packagist从公司防火墙后面的作曲家遇到问题。 The firewall was blocking us from accessing a particular package.json file from the http://packagist.org website
防火墙阻止我们从http://packagist.org网站访问特定的package.json文件
What was strange though was that it was only blocked over http:// connections and perfectly accessible from https:// connections. 但奇怪的是,它只能通过http://连接阻止,并且可以从https:// connections完全访问。
However, I have, after much trial and error and research, found a workaround. 但是,经过多次试验和错误研究后,我找到了一个解决方法。 It's not a particularly graceful workaround but it takes advantage of the fact that composer does not recursively resolve repository locations and only takes commands from the main project's composer.json configuration.
这不是一个特别优雅的解决方法,但它利用了这样一个事实,即composer不会递归地解析存储库位置,只接受来自主项目的composer.json配置的命令。
I realised when reading the documentation on the composer github site that you could disable the default packagist configuration. 我在阅读composer github网站上的文档时意识到你可以禁用默认的packagist配置。 In addition, of course you can add your own repositories to the composer.json in your project.
此外,您当然可以将自己的存储库添加到项目中的composer.json中。
So, adding the following to the composer.json solves the problem and I'm able to bypass the blocks put in place by the firewall. 因此,将以下内容添加到composer.json可以解决问题,并且我可以绕过防火墙设置的块。
"repositories": [
{
"type": "composer",
"url": "https://packagist.org"
},
{ "packagist": false }
hopefully this will help. 希望这会有所帮助。
In my case in installed laravel 5.2 with php 7 在我的情况下安装laravel 5.2与PHP 7
Very Simple: 非常简单:
If you have working XAMPP on your machine with latest php version 如果你在你的机器上使用最新的php版本工作XAMPP
https://getcomposer.org/ https://getcomposer.org/
install by following simple steps. 按照以下简单步骤安装。
To verify the installation Open Command Prompt (Window + R key and type cmd ) then type 要验证安装,请打开命令提示符(Window + R键并键入cmd),然后键入
composer 作曲家
Note: it is not necessary where you are in directory path of Command Prompt. 注意:在命令提示符的目录路径中没有必要。 Composer is globally accessible in Command Prompt.
可以在命令提示符中全局访问Composer。
you will see the details about composer and their respective version. 您将看到有关作曲家及其各自版本的详细信息。
After successfully installing composer install laravel by just typing the command: Ensure your working Internet 只需输入命令即可成功安装composer install laravel: 确保您的Internet工作正常
composer global require "laravel/installer" 作曲家全球需要“laravel / installer”
it will automatically download from their server and also his Dependencies. 它将自动从他们的服务器和他的依赖项下载。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.