Cannot find ~/.composer folder after installing composer - php

I have installed composer by the instructions given in their site for Ubuntu 16.04. Its giving the usual output after giving the 'composer' command in the terminal.
After installing composer, I have downloaded the composer using
composer global require "laravel/installer"
Now to install Laravel, I have to add $HOME/.composer/vendor/bin in my path. But there is no .composer folder in my home directory. Can anybody tell me why this is happening ?

In my Ubuntu 16.04.4, after downloading the Laravel installer using
composer global require "laravel/installer"
I found my Laravel here :
~/.config/composer/vendor/laravel/installer/
Then I set my .bashrc using nano ~/.bashrc and export your composer config file :
export PATH="$PATH:$HOME/.config/composer/vendor/bin"
And refresh using source ~/.bashrc in terminal
And Laravel is running, but I did not need any .composer folder as said in the Laravel official site.
This answer has helped me a lot.

Related

Error when trying to install laravel/create a laravel project on windows via composer

I want to create a new project using Laravel.
From the documentation, I downloaded Composer using its Windows executable installer.
I have already set the path to: C:\Users\marti\AppData\Roaming\Composer\vendor\bin
**I created the vendor\bin directory
From the command prompt, the command "composer" works.
I tried to install Laravel using the laravel installer and it gives me an error also with the create-project command.
I have tried both methods even with administrative privillages but still there is an error.
Using Laravel Installer:
[ErrorException]
file_put_contents(C:\Users\marti\AppData\Roaming\Composer\vendor\bin): failed to open stream: Permission denied
Using create-project method:
[InvalidArgumentException]
Composer could not find the config file: C:\Users\marti\AppData\Roaming\Composer\vendor\bin
To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting S
tarted" section
PLEASE HELP!
Error when using laravel installer
Error when using create-project method
I deleted the Composer path variable, changed directory to read "C:>" and ran the command "composer global require laravel/installer"
Try requiring Laravel installer from composer composer global require laravel/installer then simply make a new laravel project laravel new {PROJECT_NAME}
Composer(for windows), as of build v1.10.13 does not require you to manually set then env path variable.
You dont have to change or add anything in the composer installation directory or to environment path variable.
If you have done so, then do the following
Re-install composer.
Run composer in a new cmd window, to see if its is installed properly.
Run composer create-project --prefer-dist laravel/laravel <your project name> and now your project should be set up properly.

.composer file (in the home directory) is not created even after I installed Composer and Laravel

I am trying to install php framework, Laravel on my Ubuntu 16.04 Desktop. I followed the documentation and installed composer. I moved the composer.phar file to /usr/local/composer. After I excecuted
$composer global require "laravel/installer"
But I could neither find .composer file in $HOME nor could I execute
$laravel
On my terminal

How to add /import sample Laravel Project?

After familiar with Codeigniter, I stared to learn Laravel.
I able to install Laravel using following command.
composer create-project --prefer-dist laravel/laravel blog
It works fine. :-)
Next I tried to setup sample Laravel project. I found a sample project from here (https://github.com/evercode1/sample-project).
What I did is I just download it and copied all folders to Xampp htdocs folder.
Then I visit the "http://localhost/sample-project-master/public/".
It gives following error.
Warning:
require(D:\xampp\htdocs\sample-project-master\bootstrap/../vendor/autoload.php):
failed to open stream: No such file or directory in
D:\xampp\htdocs\sample-project-master\bootstrap\autoload.php on line
17
Fatal error: require(): Failed opening required
'D:\xampp\htdocs\sample-project-master\bootstrap/../vendor/autoload.php'
(include_path='D:\xampp\php\PEAR') in
D:\xampp\htdocs\sample-project-master\bootstrap\autoload.php on line
17
Have I done mistake when setting up already available Laravel project? How I correct following errors or what is the way to import Laravel project?
You should do:
1) Install composer dependencies
composer install
2) An application key need to be generated with the command
php artisan key:generate
3) Open Project in a Code Editor, rename .env.example to .env and modify DB name, username, password to your environment.
4) Migrate the database along with seed
php artisan migrate --seed
5) Now run the artisan serve command
php artisan serve
the first error is due to not getting file path for bootstrap in bootstrap folder .
you should run: composer install
3 . laravel requires vendor libraries which needs to be install , it does not come automatic with the package . because it's is git ignored . so you need to install it if needed.
You should try this
composer install
OR
composer update --no-scripts
composer update
For more details please follow this link.
This means some dependencies are messing,
Open your project root folder and run this command:
composer install
or
php composer.phar install
I believe below command should work as I have tested on Windows and Linux:
composer update --no-scripts
or if you already installed and updated the composer then check below command:
composer global update
first You have to move the project to www(folder) or htdocs if using xamp or any folder that apache load the files from
then open ur terminal or cmd , and cd untill u reach prject folder , or u can do
shift + right click in the folder , a menu will come up choose "open command window here" .
then write this command composer update this will install all the packages u need to run the project .
dont forget to modify .env file with your database information .
this should work .
You are facing this issue because your system might not have composer.laravel need dependency manager.you have to install the first composer to your htdoc folder.
You can install composer using following this command,composer installNow you can install laravel using (must run this command inside your htdoc)composer global require "laravel/installer"
Now you can create project usinglaravel new YOUR_PROJECT_NAME
OR
composer create-project --prefer-dist laravel/laravel YOUR_PROJECT_NAME
Note : it is good if you install composer and laravel on global location.
Documentation Available Here : https://laravel.com/docs/5.4/installation

yii2 installation via composer - Could not open input file: composer.phar

I am trying to install the yii2 and after I installed the composer I tried to run composer.phar global require "fxp/composer-asset-plugin:~1.1.1"
it says :
Could not open input file: composer.phar
Any suggestions ?
Make sure of composer work correctly.
php composer.phar -v
Try
php composer.phar global require "fxp/composer-asset-plugin:~1.1.1"
I know probably you've figured it out by now but still I want to help.
Make your composer.phar global so you can access it from anywhere. You can set path in environment variables or you can give direct path like below:
php C:\ProgramData\ComposerSetup\bin\composer.phar create-project --prefer-dist --stability=dev yiisoft/yii2-app-basic basic
Note: I'm using Windows 8.1 and composer is installed in C directory.
First of all install composer in your system Like windows system. you can download composer from this url https://getcomposer.org/download/. after install composer you can go to C:\composer check files for composer.phar and composer.bat files then copy both files and goto C:\xampp\php paste both files here and restart xampp then after that you can install yii2

Installing Laravel

I am on a windows 8 machine and I'm trying to learn laravel. I copy and pasted my PHP folder from C:\xampp to C:\php, installed composer, ran composer install then composer create-project laravel/laravel learning-laravel. So far everything was created so I went into the directory and tried to use 'php artisan serve' and got the following error.
C:\Users\denni_000\learning-laravel>php artisan serve
Warning: require(C:\Users\denni_000\learning-laravel\bootstrap/../vendor/autoloa
d.php): failed to open stream: No such file or directory in C:\Users\denni_000\l
earning-laravel\bootstrap\autoload.php on line 17
Why you copied php folder
download composer install it.
download laravel latest version and store it on your xampp/htdocs/laravel
and run cmd with composer install command
For more follow install laravel on windows xampp
or Laravel 4.1 installation with composer in xampp
For windows Simply download Laragon which includes latest php 5.6.7, Apache, Mysql, Redis, Memcached an alternative to Xampp or Mamp with small size. Easy to install laravel and create project with auto create virtual host by it. Thank you.
U need to go to the directory where laravel is installed and run the following command.
composer update
Install Laravel 4.2 with composer:
sudo composer.phar create-project laravel/laravel project-directory-name 4.2 --prefer-dist
Here is a different way to setup laravel, may be you guys will like it
Step 1:
Clone https://github.com/laravel/laravel or you may download zip also.
Step 2:
Navigate to downloaded folder in command prompt and run composer install
Step 3:
open the folder and rename .env.example to .env and update the credentials mentioned in file.
Step 4:
After these steps if you navigate to the directory from web-server it will cause an error No supported encrypter found. The cipher and / or key length are invalid. to fix this just run php artisan key:generate
Done!
Hope you guys like this way :)
You need to install all the laravel required dependency.
To do that, you need to tell composer to install everything needed.
Below is the command to use to install that's required in laravel composer.json.
composer install
Follow the installation guide from Laravel
Install Composer:
Like Laravel.com says: "Make sure to place the ~/.composer/vendor/bin directory in your PATH so the laravel executable can be located by your system."
Type the following statement in the command line:
composer global require "laravel/installer=~1.1"
Create a fresh Laravel project in a specified directory with the "laravel new" command:
laravel new blog
You can also create a Laravel project using composer, like such:
composer create-project laravel/laravel --prefer-dist
If you want to learn laravel I seriously recommend you use laravel homestead with vagrant.
For this you need to:
Install virtualbox.
Install vagrant.
Install git.
Install ssh.exe (Download msysgit and copy the content of bin folder to git bin folder).
Install Homestead on Vagrant (Follow the steps on laravel/homestead documentation page).
Install Laravel on Homestead (Follow the steps on laravel/installation documentation page).
This method apply to Windows, Linux or Mac, only change the step 4 on linux or mac.

Categories