我尝试运行composer update
,但出现此错误:
Fatal error: Out of memory <allocated 1520435200> <tried to allocate 268435456 bytes...>
我尝试了几种解决方案,但没有任何效果:
memory_limit = -1
进行了修改php -d memory_limit=-1 ../composer.phar update
php ../composer.phar install
(工作正常,但在运行composer update时出现相同的错误)我使用的是PHP 5.5.12,由于我的限制,我无法升级到PHP7.X。 而且我尝试升级到php 5.6,但无法解决问题,总是出现此错误:“内存不足”
这是我的composer.json:
{
"name": "symfony/framework-standard-edition",
"license": "MIT",
"type": "project",
"description": "The \"Symfony Standard Edition\" distribution",
"autoload": {
"psr-4": { "": "src/" },
"classmap": [ "app/AppKernel.php", "app/AppCache.php" ]
},
"autoload-dev": {
"psr-4": { "Tests\\": "tests/" }
},
"require": {
"php": ">=5.5.12",
"symfony/symfony": "3.4.*",
"doctrine/orm": "^2.5",
"doctrine/doctrine-bundle": "^1.6",
"doctrine/doctrine-cache-bundle": "^1.2",
"symfony/swiftmailer-bundle": "^2.3",
"symfony/monolog-bundle": "^3.0",
"symfony/polyfill-apcu": "^1.0",
"sensio/distribution-bundle": "^5.0",
"sensio/framework-extra-bundle": "^3.0.2",
"incenteev/composer-parameter-handler": "^2.0",
"twig/extensions": "~1.0",
"incenteev/composer-parameter-handler": "~2.0",
"doctrine/doctrine-fixtures-bundle": "~2.3",
"symfony/assetic-bundle": "^2.7.1",
"leafo/scssphp": "~0.6",
"patchwork/jsqueeze": "~1.0",
"coresphere/console-bundle": "dev-master",
"friendsofsymfony/user-bundle": "dev-master",
"egeloen/ckeditor-bundle": "^4.0",
"jms/serializer": "^1.7",
"vich/uploader-bundle": "^1.4",
"liuggio/excelbundle": "^2.1",
"spipu/html2pdf": "^5.0",
"ob/highcharts-bundle": "^1.6",
"ocramius/proxy-manager": "^1.0"
},
"require-dev": {
"sensio/generator-bundle": "^3.0",
"symfony/phpunit-bridge": "^3.0"
},
"scripts": {
"symfony-scripts": [
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget"
],
"post-install-cmd": [
"@symfony-scripts"
],
"post-update-cmd": [
"@symfony-scripts"
]
},
"config": {
"platform": {
"php": "5.5.12"
}
},
"extra": {
"symfony-app-dir": "app",
"symfony-bin-dir": "bin",
"symfony-var-dir": "var",
"symfony-web-dir": "web",
"symfony-tests-dir": "tests",
"symfony-assets-install": "relative",
"incenteev-parameters": {
"file": "app/config/parameters.yml"
},
"branch-alias": {
"dev-master": "3.2-dev"
}
}
}
也许是引起错误的原因,而不是内存是问题所在,但我不知道为什么。
我发现的所有解决方案都不适合我,有人可以帮忙吗?
------编辑------
因此,解决我的问题的方法是将操作系统版本升级到x64,将php5.5 x32升级到php 7.2 x64。通过这些升级,我可以毫无问题地使用作曲家!