L
L
Lev Vorobyov2020-02-16 13:19:25
Yii
Lev Vorobyov, 2020-02-16 13:19:25

How to upload an extension for Yii2 to hosting?

I can download any extension for Yii2 on my local, for example, through Composer:

composer require kartik-v/yii2-widget-datepicker "@dev"

And how now to upload this extension to the hosting? As I understand it, is it installed somewhere in the vendor? It’s just that now I’m re-uploading the entire folder with the project to the host, but obviously there are easier ways

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim, 2020-02-16
@thylaakari

1. Find out if composer is installed on the hosting. If installed, then you're in luck. You have a more comfortable work with the project. Upload all files and composer.json file. Further php composer updateAnd all. The project is installed. But you should not rejoice. Installed composer on hosting is not always happiness. Since it is installed globally, and you do not have admin rights, it may not allow you to create temporary files like .cache and others. Here you have to dodge and change the storage paths for such files in the composer.json section of the config.
2. If you have a very sad case, you can download the latest composer package (composer.phar). Throw it in the project folder and install packages through it with the commandphp composer.phar update
3. If neither of these works, then install the packages on the local machine and simply update the vendor folder with each change. I hope it doesn't come to that.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question