1
votes

I want to change color of my image. So I'm trying to use image/intervention of laravel. Followed their documentation: http://image.intervention.io/getting_started/installation https://packagist.org/packages/intervention/image

When i tried the following, i got an memory exhausted error:

1. composer require intervention/image

Error: PHP Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes) in phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/DependencyResolver/Solver.php on line 223

Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes) in phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/DependencyResolver/Solver.php on line 223

Check https://getcomposer.org/doc/articles/troubleshooting.md#memory-limit-errors for more info on how to handle out of memory errors. E:\xampp\htdocs\Myproject>php -r "echo ini_get('memory_limit').PHP_EOL;" 512M

So, i followed the below link and increased to memory_limit=-1 from memory_limit=512M https://getcomposer.org/doc/articles/troubleshooting.md#memory-limit-errors

Now, again tried this command composer require intervention/image. Now i got a different error:

Error: Your requirements could not be resolved to an installable set of packages.

Problem 1 - This package requires php ~7.2.0 but your PHP version (7.3.11) does not satisfy that requirement. Problem 2 - mpociot/vat-calculator dev-master requires ext-soap * -> the requested PHP extension soap is missing from your system. - mpociot/vat-calculator dev-master requires ext-soap * -> the requested PHP extension soap is missing from your system. - mpociot/vat-calculator dev-master requires ext-soap * -> the requested PHP extension soap is missing from your system. - Installation request for mpociot/vat-calculator dev-master -> satisfiable by mpociot/vat-calculator[dev-master].

To enable extensions, verify that they are enabled in your .ini files: - E:\xampp\php\php.ini You can also run php --ini inside terminal to see which files are used by PHP in CLI mode.

Installation failed, reverting ./composer.json to its original content.

Why am i getting these errors? How can i install image/intervention package in my application? I'm using laravel 5.5 , PHP 7.3.11

As the error says, do i have to install 7.2.0 php version? Or is there any other solutions?

1
Hi, the first problem seems to mean that you have a dependency on PHP in your composer.json. Maybe you need to update it. The second problem is because you are missing soap extension in PHP. Try to install it. This question/anwser could help you. - GrenierJ
@GrenierJ, I enabled soap extension as given in that link. Soap error is gone now. How can i find which dependency needs a update? does composer diagnose command help in this? - Prathika T
I think you have something like "php": "~7.2", in your composer.json - GrenierJ
So you need to change it to ^7.2 to allow all versions of PHP upper than 7.2. And run composer update php. - GrenierJ
Yes you can ignore this. It's only you have some dependencies that use abandonned dependencies ( maybe update them). Whit composer depends --tree <dependecyName> you can see why this dependency is needed and maybe try to update parent dependeny. - GrenierJ

1 Answers

1
votes

The first problem come because there is something like "php": "~7.2", in your composer.json. Change to "php": ^7.2" to allow all PHP minor version upper 7.2. Run composer update php to fix composer.lock

The second problem is because you are missing soap extension in PHP. Try to install it. This question/anwser could help you.