简体   繁体   中英

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. 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\\Downloader\\TransportException] The " http://packagist.org/p/illuminate/filesystem $a5912ddb14272c0efa16e821a25bb68e39d3bac736aee7de62cb5641fd7133e3.json" file could not be downloaded: failed to open stream: HTTP request failed!

Four simple steps to install laravel on windows machine:

  1. After installing xampp, just download composer from https://getcomposer.org/download/ and install it.
  2. goto path C:/xampp/htdocs and create a folder as laravel, redirect to laravel using cmd prompt as cd c:\\xampp\\htdocs\\laravel.
  3. then simply type this command to create a first project composer create-project laravel/laravel first-project --prefer-dist Replace first-project with your project name (it takes a few minutes to install)
  4. then redirect to localhost/laravel/first-project/public/ and now you can see the Laravel logo along with a quick message saying “You have arrived.” ( always use a public folder to access project )

Few steps to install for Windows Xampp,

  1. Download Composer here http://getcomposer.org/
  2. Download master copy here https://github.com/laravel/laravel/archive/master.zip
  3. Paste the master in xampp/htdocs/your-project-name/[paste the master copy of laravel here]
  4. Go to Command prompt : Start Menu -> Run -> Type cmd or command or Window Key + R and type cmd or command.
  5. Go the path xampp/htdocs/your-project-name/ in command prompt and type composer install.
  6. It will automatically download the necessary files.

Hope this will help.

Go to: 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.

Another method consists into the installation of Composer:

http://getcomposer.org/doc/00-intro.md#installation-windows

And then run this command from the prompt of commands (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. The firewall was blocking us from accessing a particular package.json file from the http://packagist.org website

What was strange though was that it was only blocked over http:// connections and perfectly accessible from 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.

I realised when reading the documentation on the composer github site that you could disable the default packagist configuration. In addition, of course you can add your own repositories to the composer.json in your project.

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.

"repositories": [
{
     "type": "composer", 
     "url": "https://packagist.org"
},
{ "packagist": false }

hopefully this will help.

In my case in installed laravel 5.2 with php 7

Very Simple:

If you have working XAMPP on your machine with latest php version

  1. Download the Composer from official site

https://getcomposer.org/

install by following simple steps.

  1. To verify the installation Open Command Prompt (Window + R key and type cmd ) then type

    composer

Note: it is not necessary where you are in directory path of Command Prompt. Composer is globally accessible in Command Prompt.

you will see the details about composer and their respective version.

  1. After successfully installing composer install laravel by just typing the command: Ensure your working Internet

    composer global require "laravel/installer"

it will automatically download from their server and also his Dependencies.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM