I was following a noobies guide to Laravel, but sadly I am stumped on step one..
I have tried many threads relating to the same thing, but none seem to work - and I am stumped.
I have followed to the letter, this helpful video, and never diverted in any detail.
https://www.youtube.com/watch?v=JNn_tS2KpcY
For example I have changed all the required extension=php_openssl.dll's mentioned in posts such as this:
https://stackoverflow.com/questions/16940582/laravel-4-composer-error/16940691#16940691
As you might expect I am very new to coding, so I have provided images to help illustrate things I am not too sure about.
Firstly I download and install the .phar file, and my folder structure and files look like:
This is setup globally I assume? I also have the PATH variables added correctly when the installation prompts to add them.
So next I run composer in my command line, and successfully receive:
This to me, indicates Composer is installed at least?
Ok, next I make a folder in my WAMP server, and copy the contents from "Laravel-Master", which is from Laravels GIT and quick start guide:
Next I cd to the www folder and run the command:
composer create-project laravel/laravel your-project-name --prefer-dist
Things seem to go fine, and it does make a new Laravel "project-name" (if the folder is empty)
but then errors:
Composer could not find the config file: c: programdata\composer setup\bin To initialize a project, please create a composer.json file.
This is most annoying as I stick very close to the video linked above, but do not get the same results.
Thanks very much for your time.
Your Composer installation is misconfigured (or rather un-configured.) I don't know what that video says about installing Composer however I would download an installation executable here for Windows and follow the instructions.
If you have done this, great! However something got screwed up in the installation process, so you should try running the same installer again.
According to this and this, you could also try this command instead:
COMPOSER=composer.json composer create-project laravel/laravel your-project-name --prefer-dist
You would be better suited with Laravel Homestead, which already comes with everything you need to run Laravel in a Vagrant Box
http://laravel.com/docs/4.2/homestead
Related
I've got a Laravel project and simple pipeline in Jenkins which build Docker image from Dockerfile, pull code in it and execute composer install. Everything working fine so far, but installing composer packages takes a lot of time (like 6-7 minutes). I've tried to persist vendor directory somewhere, create symlink to it or something but nothing worked so far. I wonder if there is some better more official way to handle that? Anyone has some idea or experience in it? Or maybe some different CI tool?
Ok, I ended up with two solutions:
I mounted composer cache directory to some directory in host to speed up composer packages installing:
dockerfile {
filename 'Dockerfile'
args '-v $HOME/composer_cache:/.composer/cache'
}
There is (not so obvious, because Jenkins panel is little messy) option to disable workspace clean up before/after code checkout. One can delete those steps in pipeline configuration under "Branch Sources" section (with red X above those "Behaviours").
I am using composer for my project and the entire project (even the vendor folder) is under git version control.
I know it may seem like a false action but I am in bandwidth deficit and I want to lower my bandwidth usage so I use this method to just copy the vendor folder.
When I push to to another repository and try to run php main.php from there It says that can not find the classes that I am using there.
I have managed to solve this problem by removing the whole vendor folder and re running composer i but it is not the behavior that I want. I want low bandwidth usage, I want to not wait for package installation.
I am using the same method for virtualenv of python apps and there is the same problem but that problem can be solved by just running virtualenv venv/ again so it corrects the new paths for the copied environment. How can I achieve the same behavior with composer? I dont see any info or command that can help me doing this.
Thanks in advance folks :)
Found the solution.
All you need to do is to remove one file and one folder:
rm -rf vendor/composer;
rm vendor/autoload.php;
Then run composer i and it will recreate the removed composer folder again and corrects the autoload files.
Have a nice day.
I've recently installed composer and also installed laravel installer from composer from the commmand line just like they said in laravel documentation.
But when I used the laravel command on the command line, it show error:
sh.exe": laravel: command not found
I also added environment variable in the path variable.
~/.composer/vendor/bin
But still the same error occurs while using the laravel command.
I'm a laravel newbie and I'm stuck in laravel installation.I've searched lot of times but still could not get the solution. I've read lot of users' questions with the same problem and used their solutions but still could not fix this.
Your path /c/xampp/php:~/.composer/vendor/bin is definitly wrong. Either you have to fix it (should be something like C:/{path_to_your_composer_directory}) or you can simply use composer create-project laravel/laravel --prefer-dist to install a new laravel project.
I would go with the 2nd option, because you don't have to configure something else.
On windows system, please remove . from path (just before .Composer)
I've searched many answers to this problem, and a alternative solution to this project to still get what I try to achieve, but I want to know why it is not working the 'regular' way, and if it is possible to fix it somehow. I checked out this post where I found my alternative solution.
I installed laravel and I'm trying to create a project with laravel. However, when I run this command
composer create-project laravel/laravel cms
I get the following error: [InvalidArgumentException] - Composer could not find the config file
I followed all installation settings via a tutorial, created the composer enviroment variable, so those settings should be correct. Does somebody know why this is not working and how I might be able to fix this?
Edit: To clarify, as Joe commented, composer commands do work.
first, run the following command:
composer global require "laravel/installer=~1.1"
then, add ~/.composer/vendor/bin to your PATH. this way your system knows where the laravel installer is.
When this is done, you can simple use the following command to make a new project:
composer create-project laravel/laravel --prefer-dist
I had this problem myself since i was used to use composer to init a laravel project. However, after setting up this installer, i honestly love it. It has a bunch of neat options you can use ;-)
For more info, look here
I am currently trying to install Omnipay into my Codeigniter project. I am stuck on windows because I do not have ssh access to the box where this needs to run on. So far I have gotten a new directory in the project root that is named "vendor" and it contains a lot of empty directories referring to Symfony (for what reason is beyond me).
Then I get a runtime exception that I need to enable the openssl extension in my php to download the necessary files and this is where I am stuck at. I don't run WAMP on my computer and I just use the php.exe I downloaded to work with netbeans.
Isn't there an easier way to get omnipay to run? Like just download the files from somewhere and plug them into my project like normal? It seems to be an aweful lot of headache to get a simple library to run in my CI project.
Please forgive my ignorance towards composer but I currently see no benefit of using it for this particular project.
You can "just download" the files here: https://github.com/omnipay/common/archive/master.zip
The problem is, Omnipay depends on Guzzle (an HTTP library), and Guzzle depends on some Symfony components. So you will spend the rest of the day downloading dependencies and making sure you have all the necessary files. That is the problem Composer solves for you.
I don't have any experience running Composer on Windows, but I would start here:
http://getcomposer.org/doc/00-intro.md#installation-windows
Using the Installer
This is the easiest way to get Composer set up on your machine.
Download and run Composer-Setup.exe, it will install the latest
Composer version and set up your PATH so that you can just call
composer from any directory in your command line.
Once you have Composer installed, you should simply be able to make a file named composer.json in your project root, with the following contents:
{
"require": {
"omnipay/omnipay": "~2.0"
}
}
Then use the Command Prompt and cd to your project's directory, and run composer update to download the Omnipay files and all their dependencies.