Sympony 3 knp paginator file not found

I am creating a blog in symfony 3 and Sonata. I would like to use paginator knp, so I put this command:

require knplabs/knp-paginator-bundle

It gives me this error:

PHP Fatal error:  Allowed memory size of 1073741824 bytes exhausted (tried to allocate 4096 bytes) in

      

Far: ///usr/local/bin/composer.phar/src/Composer/DependencyResolver/Solver.php on line 220

So, I did this:

php -d memory_limit=-1 composer require knplabs/knp-paginator-bundle

      

This gives me the following:

Could not open input file: composer

      

If I just add a line to my composer.json file and run the linker it gives me the same size error, if I add "php -d memory_limit = -1" it tells me "couldn't open input file: composer" I didn't get this error, I already used this "php -d memory limit" and it worked fine, I don't know what to do next. I need a paginator package for my project Anyone have any ideas?

+3


source to share


1 answer


This usually happens when you are using globally installed files composer.phar

. So you have to (1) find the absolute path for the installed composer file, then (2) use the absolute path in php use, like:

~ ᐅ php -d memory_limit=-1 composer
Could not open input file: composer
~ ᐅ which composer
/usr/local/bin/composer
~ ᐅ php -d memory_limit=-1 /usr/local/bin/composer
   ______
  / ____/___  ____ ___  ____  ____  ________  _____
 / /   / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/
/ /___/ /_/ / / / / / / /_/ / /_/ (__  )  __/ /
\____/\____/_/ /_/ /_/ .___/\____/____/\___/_/
                    /_/
Composer version 1.4.1 2017-03-10 09:29:45

      



Hope for this help

+2


source







All Articles