how to run a github pulled project with laravel? - php

i just cloned a project from bitbucket with sourcetree. Now i am trying to run it with laravel. I started my cmd with administrator rights and i am in the right directory of the project. Now when i try to do the 'composer update' command i get this error in my command line :
i know this topic was been discussed before but i couldn't find the answer in them for me. This must have something to do with the fact that me and my friend are making this laravel project together and we are using source tree with bitbucket as a version control system , he can run the project on his computer but when i pull it , it stopped working. Is there annything i need to keep in in mind when using laravel with git ?

I had the same problem when i cloned the repository from github.
what id did is
Composer Install
using the terminal in my app directory. It worked A1!
hope this helps

You may have to use composer install because laravel by default exludes the following directories from git:
/vendor
/node_modules
.env
Which could be causing your error
Another similar question was asked here covering the same error: Laravel 4: Fatal error: Class 'Patchwork\Utf8\Bootup' not found in autoload.php

Related

Interface 'Monolog\ResettableInterface' not found when running a new project

Whenever I try to run any command related to php artisan or composer this error shows up:
PHP Fatal error: Interface 'Monolog\ResettableInterface' not found in path\to\project\root\vendor\monolog\monolog\src\Monolog\Logger.php on line 28
I open the file, and it points me to :
class Logger implements LoggerInterface, ResettableInterface
I try to find the Logger interface and it's there.
I really can't find any other solutions and the ones recommended here by SO are outdated.
I use laravel 5.7 running composer version 1.8.0 on a xampp server with PHP 7.2.10 on Windows 10
Please feel free to ask more questions and I'll try to answer them without ruining my NDA.
Update: it works now thanks to that one person who answered.
If anyone needs this solution, you can do what Saumini Navaratnam suggested; removing the vendor folder and running composer update on the root folder. I, myself found another solution that might work and it is: running composer update --no-dev as the ResettableInterface came from a dev dependency. Weird, but it works fine now.
Again this works only on Laravel 5.7, at least for now.

Installing existant laravel project on wamp for pre-production

I have a existing laravel project that I have been working on for a while now.
I have to put it in a test environnement to show it to my employer.
My problem is that I have no clue how to use my git repo of the project to put it on a fresh installation of wamp server.
1 - I have tried to install it as a whole but failed.
2- Then, I tried creating a fresh copy of Laravel base architecture (that worked) and after, replacing the files I modified on my existing project over on the fresh Laravel project. Turns out, it can not find my login.php page and I am stuck at that point.
So I want to find the easiest way to clone a git repo with an existing Laravel project directly on a wamp server and make it work.
I have been trying for several weeks, please help me.
Thanks
Okay, here are some simple steps to create a copy of your Laravel5 project on another server:
Setup the server (Databases, PHP and so on) and install Composer. If you are local, composer should already be installed
Clone the repository and copy the content to the htdocs or var/www folder, depending on your server system
Now execute composer update to load all dependencies
Last but not least, setup your .env file. Use the .env.example from Laravel5, add your credentials, generate a key with php artisan key:generate
That's it. Now your Laravel5 project should run.

laravel command not found while using laravel command

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)

Laravel setup project file fails

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

Laravel 4 /Composer Install Error

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

Categories