I'm using laravel + composer . I'm loading way/generators package and when I run composer update give me this error:
Loading composer repositories with package information Updating
dependencies (including require-dev)
Fatal error: Allowed memory size of 536870912 bytes exhausted (tried
to allocate 67108864 bytes) in
phar:///usr/local/Cellar/composer/1.0.0-alpha8/libexec/composer.phar/src/Composer/DependencyResolver/Solver.php
on line 170
I think, This is because composer update has used all the memory.
php -d memory_limit=1G /usr/local/Cellar/composer/1.0.0-alpha8/libexec/composer.phar update
This works for me on a mac.
Also check out to use composer install.
If you are on a server with less amount of RAM like 512MB you will need to create swap memory. Here is how you do it on ubuntu
touch swap.img
chmod 600 swap.img
Using 1GB for swap
dd if=/dev/zero of=/var/swap.img bs=1024k count=1000
mkswap /var/swap.img
swapon /var/swap.img
Here is the full article https://www.digitalocean.com/community/tutorials/how-to-configure-virtual-memory-swap-file-on-a-vps
I was having problem to install laravel with composer.
Original command was:
composer global require "laravel/installer=~1.1"
And Error message was:
Loading composer repositories with package information Updating dependencies (including require-dev)
Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 67108864 bytes) in phar:///usr/local/Cellar/composer/1.0.0-alpha8/libexec/composer.phar/src/Composer/DependencyResolver/Solver.php on line 170
Following command should work:
php -dmemory_limit=1G /usr/local/Cellar/composer/1.0.0-alpha8/libexec/composer.phar global require "laravel/installer=~1.1"
In my case I encountered the same problem and manage to solve by halting the Apache and MySQL service and then proceeding to install the laravel application via composer.
The sudo service stop apache2 followed by sudo service stop mysql stop this in turn killed the application that were consuming memory I then proceeded to install the Laravel via the normal composer command once done I just restarted the service and everything was fine.
I found solution, after read this post: https://github.com/composer/composer/issues/1898
Thank you to "Dynom, commented on Jul 4, 2013"
Needing 512MiB RAM for a package-manager is already a bit much, but I
also exceed it. The interesting part is that I exceed 512 MiB RAM (up
to around 800 MiB RAM according to my process output) when I use my
private Satis repository (which is actually just a cache for all
Github public repositories). I do not exceed it otherwise. Just by
adding my satis repository, composer consumes almost 400 MiB more RAM
To all the others raising their PHP CLI memory_limit globally, I
recommend against that. Instead I suggest to put it in the command
line, like so:
php -dmemory_limit=1G {composer location} update
Example:
php -dmemory_limit=1G bin/composer.phar update
Otherwise you could potentially miss certain unintended memory related
behaviour in your own work.
Tested on: Debian version 6
Do you have the last version of composer? I've fixed that problem with a simple update:
sudo composer self-update
Related
PHP version 7.3.22
Running on Laravel Framework version 8
root#df77c47e6f1e:/var/www/oracle-laravel-v8# composer require yajra/laravel-oci8:^8
PHP Warning: PHP Startup: Unable to load dynamic library 'oci8_12c' (tried: /usr/lib/php/20180731/oci8_12c (/usr/lib/php/20180731/oci8_12c: cannot open shared object file: No such file or directory), /usr/lib/php/20180731/oci8_12c.so (/usr/lib/php/20180731/oci8_12c.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'pdo_oci' (tried: /usr/lib/php/20180731/pdo_oci (/usr/lib/php/20180731/pdo_oci: cannot open shared object file: No such file or directory), /usr/lib/php/20180731/pdo_oci.so (/usr/lib/php/20180731/pdo_oci.so: cannot open shared object file:
No such file or directory)) in Unknown on line 0
Warning from https://repo.packagist.org: You are using an outdated version of Composer. Composer 2.0 is about to be released and the older 1.x releases will self-update directly to it once it is released. To avoid surprises update now to the latest 1.x version which will prompt you before self-updating to 2.x.
Run composer self update command and clear composer cache
composer self-update
Then
composer clear-cache
There is nothing wrong about laravel and composer here. It seems that your system's php installation/configuration is wrong (pdo_oci extension is missed or misconfigured) so it can't process anything, even fails at composer startup.
Composer itself is package manager written in php. And laravel is framework written in php. So it's laravel is running on php, not vice versa.
This question already has answers here:
Composer require runs out of memory. PHP Fatal error: Allowed memory size of 1610612736 bytes exhausted
(39 answers)
Closed 2 years ago.
I am working on a laravel project and after taking clone of files from Github.
When Running Composer update command bellow error is coming
VirtualAlloc() failed: [0x00000008] Not enough memory resources are available to process this command.
VirtualAlloc() failed: [0x00000008] Not enough memory resources are available to process this command.
PHP Fatal error: Out of memory (allocated 868220928) (tried to allocate 58720256 bytes) in phar://C:/composer/composer.phar/src/Composer/DependencyResolver/RuleSet.php on line 90
Fatal error: Out of memory (allocated 868220928) (tried to allocate 58720256 bytes) in phar://C:/composer/composer.phar/src/Composer/DependencyResolver/RuleSet.php on line 90
you should set your memory_limit = -1 in your php config php.ini, but do not forget in production to let the default memory_limit and only do a composer install --no-dev.
This way, composer will do the install of your vendors based on composer.lock file.
You should also do the composer install --no-dev on your local machine to make sure that you have no developpement dependencies not compatible with the production environnement.
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?
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.
I am trying to install a composer package and I continuously get the following error:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested package rondobley/extended-respect-validation could not be found in any version, there may be a typo in the package name.
Here is the composer.json
{
"minimum-stability": "dev",
"require": {
"rondobley/extended-respect-validation": "^1.0"
}
}
And the output from composer install -vvv:
vagrant#wheezy:/code/test$ composer install -vvv
Reading ./composer.json
Loading config file ./composer.json
Checked CA file /etc/ssl/certs/ca-certificates.crt: valid
Executing command (/code/test): git branch --no-color --no-abbrev -v
Executing command (/code/test): git describe --exact-match --tags
Executing command (/code/test): git log --pretty="%H" -n1 HEAD
Failed to initialize global composer: Composer could not find the config file: /home/vagrant/.composer/composer.json
To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section
Running 1.2.0 (2016-07-19 01:28:52) with PHP 5.5.38-1~dotdeb+7.1 on Linux / 3.2.0-4-amd64
Loading composer repositories with package information
Downloading https://packagist.org/packages.json
Writing /home/vagrant/.composer/cache/repo/https---packagist.org/packages.json into cache
Updating dependencies (including require-dev)
Reading /home/vagrant/.composer/cache/repo/https---packagist.org/p-provider-2013.json from cache
Reading /home/vagrant/.composer/cache/repo/https---packagist.org/p-provider-2014.json from cache
Reading /home/vagrant/.composer/cache/repo/https---packagist.org/p-provider-2015.json from cache
Reading /home/vagrant/.composer/cache/repo/https---packagist.org/p-provider-2015-10.json from cache
Reading /home/vagrant/.composer/cache/repo/https---packagist.org/p-provider-2016-01.json from cache
Reading /home/vagrant/.composer/cache/repo/https---packagist.org/p-provider-2016-04.json from cache
Reading /home/vagrant/.composer/cache/repo/https---packagist.org/p-provider-2016-07.json from cache
Reading /home/vagrant/.composer/cache/repo/https---packagist.org/p-provider-archived.json from cache
Reading /home/vagrant/.composer/cache/repo/https---packagist.org/p-provider-latest.json from cache
Resolving dependencies through SAT
Dependency resolution completed in 0.001 seconds
Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested package rondobley/extended-respect-validation could not be found in any version, there may be a typo in the package name.
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
The package seems to be fine to me:
https://packagist.org/packages/rondobley/extended-respect-validation
It is a new package, just published today, but it has been several hours. I have also tried composer clearcache and that does not help. I have read many of the other similar issues here with no luck. I am new to publishing composer packages, so maybe I an missing a simple step?
Ideally I would like to install version ^1.0.
Thanks for the help in advance.
See https://twitter.com/packagist/status/772034610632990720 - it was a temporary failure on packagist
I'm getting started with a Laravel 5 project and trying to run some experiments using 'php artisan tinker' (psy shell), but I'm running into some weirdness. In the tinker/psy shell, pressing any of the arrow keys is printing character literals to the screen rather than performing the intended behaviour (move character for left and right, cycle recent commands for up and down).
Up is outputting ^[[A.
Down is outputting ^[[B.
Right is outputting ^[[C.
Left is outputting ^[[D.
This is probably an issue with my terminal and not a Laravel bug. I am getting the same buggy behaviour when running php -a.
I am running terminal on OSX, with an xterm emulation.
The PHP REPL does not implement readline's line editing and history capabilities. I don't know if there's a PHP module that implements it, but you can do:
rlwrap php artisan tinker
You may have to install rlwrap for your OS.
This is due to PHP not being built with readline support. You can enable this when you compile and build PHP with the --with-readline argument.
http://php.net/manual/en/features.commandline.interactive.php
MY os: centos
I solved the problem by :
sudo yum install rlwrap
alias tinker='rlwrap php artisan tinker'
In my case, I need install php7-readline
sudo zypper in php7-readline
[sudo] password for root:
Loading repository data...
Reading installed packages...
Resolving package dependencies...
The following NEW package is going to be installed:
php7-readline
1 new package to install.
Overall download size: 64.0 KiB. Already cached: 0 B. After the operation, additional 30.9 KiB will be used.
Continue? [y/n/...? shows all options] (y):
Retrieving package php7-readline-7.2.1-1.1.x86_64 (1/1), 64.0 KiB ( 30.9 KiB unpacked)
Retrieving: php7-readline-7.2.1-1.1.x86_64.rpm ......................................................................................[done (8.4 KiB/s)]
Checking for file conflicts: ....................................................................................................................[done]
(1/1) Installing: php7-readline-7.2.1-1.1.x86_64 ................................................................................................[done]