Posts

Showing posts with the label Composer Php

Composer Install Error - Requires Ext_curl When It's Actually Enabled

Answer : This is caused because you don't have a library php5-curl installed in your system, On Ubuntu its just simple run the line code below, in your case on Xamp take a look in Xamp documentation sudo apt-get install php5-curl For anyone who uses php7.0 sudo apt-get install php7.0-curl For those who uses php7.1 sudo apt-get install php7.1-curl For those who use php7.2 sudo apt-get install php7.2-curl For those who use php7.3 sudo apt-get install php7.3-curl For those who use php7.4 sudo apt-get install php7.4-curl Or simply run below command to install by your version: sudo apt-get install php-curl This worked for me: http://ubuntuforums.org/showthread.php?t=1519176 After installing composer using the command curl -sS https://getcomposer.org/installer | php just run a sudo apt-get update then reinstall curl with sudo apt-get install php5-curl . Then composer's installation process should work so you can finally run php composer.phar install to get the dependencies list...

Composer Update Laravel

Answer : When you run composer update , composer generates a file called composer.lock which lists all your packages and the currently installed versions. This allows you to later run composer install , which will install the packages listed in that file, recreating the environment that you were last using. It appears from your log that some of the versions of packages that are listed in your composer.lock file are no longer available. Thus, when you run composer install , it complains and fails. This is usually no big deal - just run composer update and it will attempt to build a set of packages that work together and write a new composer.lock file. However, you're running into a different problem. It appears that, in your composer.json file, the original developer has added some pre- or post- update actions that are failing, specifically a php artisan migrate command. This can be avoided by running the following: composer update --no-scripts This will run the compos...

Composer Dump-autoload Or Update Results In Fatal Error On Laravel 5.5

Answer : I just found a solution to this problem. Here it is for those who have the same problem. I have had to delete the directory kylekatarnls located inside my vendor directory then run composer update --prefer-source and after that composer dump-autoload . Now all is working just fine. It seems like you're using Composer v2. If so, read on... Composer v2 adds some new functions to their Plugin interface (namely deactivate() and uninstall() ) However kylekatarnls/update-helper < v1.2.1 is implementing said interface but does not implement the new functions . So to fix, you'll need to update kylekatarnls/update-helper to the latest (v1.2.1 at time of writing), which contains a fix (implements the missing methods): composer update kylekatarnls/update-helper I remove the vendor directory and the composer.lock file. After execute composer install and all works well.

Composer Won't Install "require-dev" Packages

Answer : Composer only ever installs the packages listed as "require-dev" of your main composer.json file, and if these packages do need something else, then only their "require" packages are installed, but not their "require-dev" packages. This actually is a good thing. If you want to contribute to an existing software package, you'd clone their repository, install everything needed for development, and are ready to contribute. But if you require that package for your own software, this is no use case to develop that particular package - it is the use case to develop your own software. So the tl;dr: Composer only installs the development requirements of the composer.json, not of any dependencies. There is a solution for installing the require-dev packages of a vendor into your project. https://github.com/wikimedia/composer-merge-plugin Add this into your composer.json of your project { "require": { "wikimedia/composer-mer...

Composer Require Ext-zip Fails

Answer : Solution #1 - add ext-zip to your required section of composer.json: { "require" : { "ext-zip": "*" } } Solution #2 - install php-zip extension: Windows: Uncomment this line in your php.ini ;extension=php_zip.dll Linux: sudo apt-get install php-zip or sudo apt-get install php7.0-zip (make sure you typed YOUR php version, you can check your version by doing php -v command) Then, you need to restart your web server. sudo service apache2 restart If your code runs OK - you've already got the zip extension installed on your machine. PHPStorm adds this suggestion to ensure that anywhere else that the project is deployed also has the right extensions too. Manually adding the line in your composer.json file ( require block) "ext-zip": "*", (and others that it can suggest, such as ext-apc , ext-redis and ext-json , as well as any others that you might be using) will make sure that when you deploy it c...