2

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?

  • 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](https://stackoverflow.com/a/22397686/6410457) could help you. – GrenierJ Mar 04 '20 at 07:49
  • @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? – Pragathy Thiyagarajan Mar 04 '20 at 09:26
  • I think you have something like `"php": "~7.2",` in your `composer.json` – GrenierJ Mar 04 '20 at 09:33
  • @GrenierJ, But, i'm still getting this error " **Problem 1 - This package requires php ~7.2.0 but your PHP version (7.3.11) does not satisfy that requirement.** " – Pragathy Thiyagarajan Mar 04 '20 at 09:53
  • @GrenierJ, yes i have "php": "~7.2.0" in composer file – Pragathy Thiyagarajan Mar 04 '20 at 09:54
  • 1
    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 Mar 04 '20 at 10:04
  • @GrenierJ, i changed "php": "~7.2.0" to "php": "~7.3.0", & ran the composer require intervention/image command. It is installed now with these warnings **Package blackfyre/json-ld is abandoned, you should avoid using it. Use blackfyre/json-ld instead. Package mtdowling/cron-expression is abandoned, you should avoid using it. Use dragonmantank/cron-expression instead. Package phpunit/phpunit-mock-objects is abandoned, you should avoid using it. No replacement was suggested. Package roumen/sitemap is abandoned, you should avoid using it. Use laravelium/sitemap instead.** can i ignore this? – Pragathy Thiyagarajan Mar 04 '20 at 10:04
  • 1
    Yes you can ignore this. It's only you have some dependencies that use abandonned dependencies ( maybe update them). Whit `composer depends --tree ` you can see why this dependency is needed and maybe try to update parent dependeny. – GrenierJ Mar 04 '20 at 10:07
  • @GrenierJ, great!! thank you for all your responses. please post this so that i can mark as answer – Pragathy Thiyagarajan Mar 04 '20 at 10:16

1 Answers1

1

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.

GrenierJ
  • 1,145
  • 8
  • 18