2016-02-21 18 views
16

Projeme doktrin yüklemeye çalışıyorum. Yanlış PHP sürümü hakkında hata alıyorum. Bu hatanın gerçek nedenini kaldırmak için neler yapılabilir? Bunu aşmanın yolu, "--ignore-platform-reqs" seçeneğini https://getcomposer.org/doc/03-cli.md#require açıklandığı şekilde kullanmaktır.Symfony2, besteci, "config.platform.php" sürümü (5.3.9) tarafından geçersiz kılınan PHP sürümünüz (5.6.18) gereksinimi karşılamıyor

PHP sürümü: PHP 5.6.18

PHP 5.6.18 (cli) (built: Feb 3 2016 17:20:21) 
Copyright (c) 1997-2016 The PHP Group 
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies 
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies 

hatası: c ..> besteci gerektiren doktrin/veri-armatürleri

Using version ^1.1 for doctrine/data-fixtures 
./composer.json has been updated 
Loading composer repositories with package information 
Updating dependencies (including require-dev) 
Your requirements could not be resolved to an installable set of packages. 

    Problem 1 
    - doctrine/migrations v1.3.0 requires php ^5.5|^7.0 -> your PHP version (5.6 
.18) overriden by "config.platform.php" version (5.3.9) does not satisfy that re 
quirement. 
    - doctrine/migrations v1.2.2 requires php >=5.4.0 -> your PHP version (5.6.1 
8) overriden by "config.platform.php" version (5.3.9) does not satisfy that requ 
irement. 
    - doctrine/migrations v1.2.1 requires php >=5.4.0 -> your PHP version (5.6.1 
8) overriden by "config.platform.php" version (5.3.9) does not satisfy that requ 
irement. 
    - doctrine/migrations v1.2.0 requires php >=5.4.0 -> your PHP version (5.6.1 
8) overriden by "config.platform.php" version (5.3.9) does not satisfy that requ 
irement. 
    - doctrine/migrations v1.1.0 requires php >=5.4.0 -> your PHP version (5.6.1 
8) overriden by "config.platform.php" version (5.3.9) does not satisfy that requ 
irement. 
    - doctrine/migrations v1.0.0 requires php >=5.4.0 -> your PHP version (5.6.1 
8) overriden by "config.platform.php" version (5.3.9) does not satisfy that requ 
irement. 
    - Installation request for doctrine/migrations ~1.0 -> satisfiable by doctri 
ne/migrations[v1.0.0, v1.1.0, v1.2.0, v1.2.1, v1.2.2, v1.3.0]. 


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

composer.json içeriği

"require": { 
    "php": ">=5.3.9", 
    "symfony/symfony": "2.8.*", 
    "doctrine/orm": "^2.4.8", 
    "doctrine/doctrine-bundle": "~1.4", 
    "doctrine/data-fixtures" : "~1.1", 
    "doctrine/doctrine-fixtures-bundle": "dev-master", 
+1

Olası yinelenen [besteci aracılığıyla DoctrineMigrationsBundle yüklenemiyor] (http://stackoverflow.com/questions/35160657/cannot-install-doctrinemigrationsbundle-via-composer) – chalasr

+0

Burada bir cevap kabul etmelisiniz. – chalasr

cevap

20

composer.json adresinde şu satırları kaldırın:

// ... 
"config": { 
    "platform": { 
     "php": "5.3.9" 
    } 
}, 
// ... 

Bkz. platform config in composer. Bir yerde de

+0

lanet, 1 dakika daha hızlı :) – Valentas

52

senin composer.json sen composer doc açıklandığı gibi blok mevcut PHP sürümünü geçersiz kılar O

"config": { 
    "preferred-install": "dist", 
    "platform": { 
     "php": "5.3.9" 
    } 
} 

var.

0

Bunu

"doctrine/doctrine-migrations-bundle": "^1.0" 

eklemeyi deneyin olabilir, ben, senin bilmediğin fark benim composer.json olarak

Symfony 2.7

ile doktrin göçler kullanmak ben Symfony2'nin docs aşağıdaki elle monte göçler, here'u okuyabilirsiniz.

Bu benim bütün 2.7 Symfony'nin bestecidir:

"require": { 
    "php": ">=5.3.9", 
    "symfony/symfony": "2.7.*", 
    "doctrine/orm": "~2.2,>=2.2.3,<2.5", 
    "doctrine/dbal": "<2.5", 
    "doctrine/doctrine-bundle": "~1.4", 
    "symfony/assetic-bundle": "~2.3", 
    "symfony/swiftmailer-bundle": "~2.3", 
    "symfony/monolog-bundle": "~2.4", 
    "sensio/distribution-bundle": "~4.0", 
    "sensio/framework-extra-bundle": "~3.0,>=3.0.2", 
    "incenteev/composer-parameter-handler": "~2.0", 
    "friendsofsymfony/user-bundle": "1.3.*@dev", 
    "ircmaxell/password-compat": "^1.0", 

    "sonata-project/block-bundle": "2.3.*@dev", 
    "sonata-project/easy-extends-bundle": "^2.1", 
    "sonata-project/datagrid-bundle": "[email protected]", 
    "sonata-project/admin-bundle": "[email protected]", 
    "sonata-project/doctrine-orm-admin-bundle": "[email protected]", 
    "sonata-project/user-bundle": "[email protected]", 
    "doctrine/doctrine-migrations-bundle": "^1.0" 

}, 
+1

Composer.json'daki "config" bölümü ile ilgilidir. –