I am trying to install laravel using composer
composer global require "laravel/installer"
but i get
I just finished reinstall my windows 7, before that laravel installation was always succesful and now it is not.. maybe someone know how solve this problem?
According to Laravel's Documentation
Make sure to place the $HOME/.composer/vendor/bin directory (or the equivalent directory for your OS) in your $PATH so the laravel executable can be located by your system.
In case of Windows you should ad that $PATH to your enviornment variables.
Related
I have a question related to composer and laravel. My question is whenever I install the fresh laravel app using command :
composer create-project laravel/laravel blog
Inside my C://xampp/htdocs/ directory and then change path to C://xampp/htdocs/blog/, here I am unable to run the composer command but I had already installed composer from its official website globally in C://xampp/htdocs/ directory. So is there any way to use composer command globally whenever I install fresh laravel app, so that I don't want to install composer in the laravel app directory everytime.
Now I guess they provide direct setting up global installation,
Check here
I did it like this a lot earlier,
Change to the path (or you can add that directory to your path later), and run the installer as mentioned on composer download site to download composer.phar.
Create a new composer.bat file alongside composer.phar.
Using cmd.exe:
run
echo #php "%~dp0composer.phar" %*>composer.bat
Then set it to path environment variable(see this)
Test with a new terminal:
composer -V
Will return
Composer version 1.10.6 2020-05-06 10:28:10
go to composer website and download the exe file, you should have it gloablly if you install it that way.
Good luck ^_^
I've set up my Homestead and i am able to connect via vagrant ssh.
I also add Laravel installer over Composer via composer global require laravel/installer.
But know, i don't know how to make it work cause in the vagrant user folder, there is no .composer/vendor folder. i figured out that the composer has installed the vendor folder under /root/.composer but when i try to access, i don't have permission cause it's in root folder.
My goal is to use the Laravel installer. For that, i need to add the path to the $PATH. Here the guideline from the docu:
Make sure to place the $HOME/.composer/vendor/bin directory (or the equivalent directory for your OS) in your $PATH so the laravel executable can be located by your system
But i can't do that in vagrant or at least i don't know how.
And yes, i know that composer is installed, that part worked.
So how can i make it work?
I fixed it.
For all others with the same issue: i need to run as administrator and i also had an outdated vagrantbox
I am new to Laravel and Composer, and am following some guides including LaraCasts.com . One of the things that need to be done is use Composer to require packages to use in the Laravel project. However, this doesn't work for me.
I installed Laravel using the composer create-project method (http://laravel.com/docs/5.0), and so far everything was fine. However, any package I "require" now actually goes into the C:\Users\user\vendor folder, and the composer.json file is in C:\Users\user.
I understand that Composer is supposed to separate between projects as opposed to being global like PEAR. So how do I specify that I'm working on a specific project and require everything into that project? Also, what is the actual path where I'm supposed to put packages in Laravel, in case I want to do it manually?
I am using Windows 7 and Xampp.
When you run composer require {pacakage}, make sure you use the cd command (Change Directory - I think) into the project you want to install the package for. So if you're in Xampp it could be something like cd C:\xampp\htdocs\my-laravel-project\ or whatever the path to your project is, then run your composer require {pacakage}.
I believe it's installing it in C:\Users\user\vendor as when you open your terminal/command prompt the default location is C:\Users\{username}\.
Please make sure you ran the composer create-project in your web root, for Xampp I think it's C:\xampp\htdocs\ but it could be different depending on how you set up Xampp when you installed it.
I'm going through the Laravel Homestead setup, but a particular instruction seems to be completely out of context/unexplained. I'm not at all familiar with composer, having only used npm for package management in the past.
In the 'Installing Homestead' section, under With Composer + PHP Tool it reads:
Once the box has been added to your Vagrant installation, you are ready to install the Homestead CLI tool using the Composer global command:
composer global require "laravel/homestead=~2.0"
Make sure to place the ~/.composer/vendor/bin directory in your PATH so the homestead executable is found when you run the homestead command in your terminal.
http://laravel.com/docs/4.2/homestead
Emphasis mine. What does this mean? What ~/.composer/vendor/bin directory? What PATH? Feels like it's missing a step!
Updating the PATH variable is slightly out of the spec of the Laravel docs as its something you should do for composer, but regardless I too think Laravel should at least link through to a resource of how to go about it.
Create/edit your ~/.bash_profile, add the following
export PATH=~/.composer/vendor/bin:$PATH
finally run source ~/.bash_profile to update your environment
I wrote a blog on this which goes into a little more detail http://blog.iwader.co.uk/updating-path-environment-variable-osx-and-unix-systems/
First,I use wamp on my Window7.I open php-openssl,and I git pull the laravel from github.com,and then I put laravel on my d:/wamp/www/, I change the c:/windows/system32.But when I open the url
http://localhost/laravel/public
I see this question.
I am a newbie on laravel,and without install on Ubuntu.Where is my wrong, without no pear,or something else? Thank you!
You need to run composer install in a command prompt.
If you do not have composer, download the phar file from their website.
Place the file you just downloaded into the laravel directory.
Then, make sure that the absolute path to php.exe is added to your PATH environment variable.
Then, you can hold down shift, and right click anywhere inside the laravel directory, and open up a command prompt window. Then, run php composer.phar install. The process may take some time, depending on the speed of your internet connection.
Instead of using the above method, you can download the Composer installer for Windows, install it, and just run composer install.
Note that you only need to do this in order to put the Laravel components together. You do not need to run it on a live server.
Please consult the Laravel Docs for installation and other instructions: http://laravel.com/docs
Try This :
Installing Laravel 4 on WAMP
1. Enable OpenSSL
OpenSSL must be enabled in the PHP configuration.
Edit php.ini in your WAMP’s PHP folder, e.g.:
C:\wamp\bin\php\php5.4.12\
Note: This is not the php.ini in C:\wamp\bin\apache\Apache2.4.4\bin.
Find the following line and remove the semicolon save it:
;extension=php_openssl.dll changed to extension=php_openssl.dll
2. Install Composer
(i).Download the Composer Windows installer from getcomposer.org.
(ii). Run the installer.
(iii). When it asks for the location of php.exe, point it to the executable in your WAMP’s PHP folder, e.g.:
C:\wamp\bin\php\php5.4.12\
(iv). Finish the installation.
(v). Open a command-line interface (cmd) and type:
composer
It should return a list of options. If you get an error, restart your computer and try again.
Composer has now been installed and added to your PATH environment variable. This means you can run it from any directory using the command-line interface.
Now we need to install Composer. This is a dependency manager that will download the latest release of Laravel and specific versions of Laravel’s dependencies, such as Doctrine and Symfony.
3.Install Laravel
Now that Composer has been installed, Composer can download and install Laravel onto your system.
(i). Open a command-line interface (cmd).
(ii). Go to the directory in which you want to install Laravel. This is usually your development directory. In this tutorial, we’ll use C:\wamp\www\laravel
(iii). Instruct Composer to install Laravel into a project directory. we use project name myproject.
composer create-project laravel/laravel myproject --prefer-dist
Note: This will install Laravel in a subdirectory myproject of the current working directory.
Three type of installation to be completed
Now your project was running directory like
C:\wamp\www\laravel\myproject\public\
After completed put tick mark and increase the point....
Do php composer.phar dump-autoload or php artisan dump-autoload