I have build web app in Yii-2.0.9 and its working very well in local and live. but i want to upload whole code in github repository. all folders/files upload successfully except the vendor folder. i tried many to upload “Vendor” folder on github repository. but i didn’t get success on it.
So, have you any idea about that? why is not uploading "Vendor" folder on github repository?
Okay, but VENDOR dir is not automatically download in github repo… and getting below errors on site causing missing VENDOR dir.
Warning: require(/var/www/html/vendor/autoload.php): failed to open stream: No such file or directory in /var/www/html/index.php on line 7
Fatal error: require(): Failed opening required ‘/var/www/html/vendor/autoload.php’ (include_path=’.:/usr/local/lib/php’) in /var/www/html/index.php on line [b]7
[/b]Is ther any command to put verndor dir in github repo?[b]
I already tried that via command prompt in my local repo, but its created vendor folder in local repo. but while pushing all code in repo at that time vendor folder doesn’t push on repo.
I don’t know why you should be pushing the vendor folder to GitHub! You can always have the latest downloaded for you using composer.
However, if you insist, there is a file called .gitignore in the project root. Open that file and comment out the line that has
'/vendor'
Now since you have already committed and the .gitignore was cached, you want to clear the cache and load the new .gitignore. First commit all unsaved changes and then run
git rm -r --cached
to load the new file. After that you should be able to commit your vendor files to Github
The ‘Vendor’ folder consist of 3rd party code put into components. So instead of putting these code in your project you can simply add them to your json file. Think of it as a list of plugins. The reason is that it’s just duplicated.
composer update
Once you download the git file, you can run composer update. This tells composers to go get the required plugins by downloading from the list, most likely also on github. It keeps your git filled with only the essential code that is not available elsewhere.