2017-09-27 149 views
1

我試圖從5.3更新laravel/laravel5.4,並這樣做,我已經修改composer.json這樣:如何將laravel/laravel從5.3更新爲5.4?

{ 
     "name" : "laravel/laravel", 
     "description" : "The Laravel Framework.", 
     "keywords" : [ 
      "framework", 
      "laravel" 
     ], 
     "license" : "MIT", 
     "type" : "project", 
     "require" : { 
      "php" : ">=5.6.4", 
      "laravel/framework" : "5.4.*", 
      "h4cc/wkhtmltopdf-amd64" : "0.12.x", 
      "h4cc/wkhtmltoimage-amd64" : "0.12.x", 
      "barryvdh/laravel-snappy" : "^0.3.3", 
      "greggilbert/recaptcha" : "dev-master" 
     }, 
     "require-dev" : { 
      "fzaninotto/faker" : "~1.4", 
      "mockery/mockery" : "0.9.*", 
      "phpunit/phpunit" : "~5.7", 
      "symfony/css-selector" : "2.8.*|3.0.*", 
      "symfony/dom-crawler" : "2.8.*|3.0.*", 
      "barryvdh/laravel-ide-helper" : "^2.2", 
      "guzzlehttp/guzzle" : "~6.0" 
     }, 
     "autoload" : { 
      "classmap" : [ 
       "database" 
      ], 
      "psr-4" : { 
       "App\\" : "app/" 
      } 
     }, 
     "autoload-dev" : { 
      "classmap" : [ 
       "tests/TestCase.php" 
      ] 
     }, 
     "scripts" : { 
      "post-root-package-install" : "php -r \"copy('.env.example', '.env');\"", 
      "post-create-project-cmd" : "php artisan key:generate", 
      "post-install-cmd" : [ 
       "Illuminate\\Foundation\\ComposerScripts::postInstall", 
       "php artisan optimize" 
      ], 
      "post-update-cmd" : [ 
       "Illuminate\\Foundation\\ComposerScripts::postUpdate", 
       "php artisan optimize" 
      ] 
     }, 
     "config" : { 
      "preferred-install" : "dist" 
     } 
    } 

然後我跑

$ composer update 

似乎composer沒有做什麼:

Loading composer repositories with package information 
Updating dependencies (including require-dev) 
Package operations: 0 installs, 0 updates, 0 removals 
Generating autoload files 
> Illuminate\Foundation\ComposerScripts::postUpdate 
> php artisan optimize 
Generating optimized class loader 
The compiled class file has been removed. 

當我然後跑

$ php artisan --version 

輸出爲:

Laravel Framework version 5.3.31 

composer.lock我發現這一點:

{ 
     "name": "laravel/framework", 
     "version": "v5.3.31", 
     "source": { 
      "type": "git", 
      "url": "https://github.com/laravel/framework.git", 
      "reference": "e641e75fc5b26ad0ba8c19b7e83b08cad1d03b89" 
     }, 
     "dist": { 
      "type": "zip", 
      "url": "https://api.github.com/repos/laravel/framework/zipball/e641e75fc5b26ad0ba8c19b7e83b08cad1d03b89", 
      "reference": "e641e75fc5b26ad0ba8c19b7e83b08cad1d03b89", 
      "shasum": "" 
     }, 
     "require": { 
      "classpreloader/classpreloader": "~3.0", 
      "doctrine/inflector": "~1.0", 
      "ext-mbstring": "*", 
      "ext-openssl": "*", 
      "jeremeamia/superclosure": "~2.2", 
      "league/flysystem": "~1.0", 
      "monolog/monolog": "~1.11", 
      "mtdowling/cron-expression": "~1.0", 
      "nesbot/carbon": "~1.20", 
      "paragonie/random_compat": "~1.4|~2.0", 
      "php": ">=5.6.4", 
      "psy/psysh": "0.7.*|0.8.*", 
      "ramsey/uuid": "~3.0", 
      "swiftmailer/swiftmailer": "~5.4", 
      "symfony/console": "3.1.*", 
      "symfony/debug": "3.1.*", 
      "symfony/finder": "3.1.*", 
      "symfony/http-foundation": "3.1.*", 
      "symfony/http-kernel": "3.1.*", 
      "symfony/process": "3.1.*", 
      "symfony/routing": "3.1.*", 
      "symfony/translation": "3.1.*", 
      "symfony/var-dumper": "3.1.*", 
      "vlucas/phpdotenv": "~2.2" 
     }, 
     "replace": { 
      "illuminate/auth": "self.version", 
      "illuminate/broadcasting": "self.version", 
      "illuminate/bus": "self.version", 
      "illuminate/cache": "self.version", 
      "illuminate/config": "self.version", 
      "illuminate/console": "self.version", 
      "illuminate/container": "self.version", 
      "illuminate/contracts": "self.version", 
      "illuminate/cookie": "self.version", 
      "illuminate/database": "self.version", 
      "illuminate/encryption": "self.version", 
      "illuminate/events": "self.version", 
      "illuminate/exception": "self.version", 
      "illuminate/filesystem": "self.version", 
      "illuminate/hashing": "self.version", 
      "illuminate/http": "self.version", 
      "illuminate/log": "self.version", 
      "illuminate/mail": "self.version", 
      "illuminate/notifications": "self.version", 
      "illuminate/pagination": "self.version", 
      "illuminate/pipeline": "self.version", 
      "illuminate/queue": "self.version", 
      "illuminate/redis": "self.version", 
      "illuminate/routing": "self.version", 
      "illuminate/session": "self.version", 
      "illuminate/support": "self.version", 
      "illuminate/translation": "self.version", 
      "illuminate/validation": "self.version", 
      "illuminate/view": "self.version", 
      "tightenco/collect": "self.version" 
     }, 
     "require-dev": { 
      "aws/aws-sdk-php": "~3.0", 
      "mockery/mockery": "~0.9.4", 
      "pda/pheanstalk": "~3.0", 
      "phpunit/phpunit": "~5.4", 
      "predis/predis": "~1.0", 
      "symfony/css-selector": "3.1.*", 
      "symfony/dom-crawler": "3.1.*" 
     }, 
     "suggest": { 
      "aws/aws-sdk-php": "Required to use the SQS queue driver and SES mail driver (~3.0).", 
      "doctrine/dbal": "Required to rename columns and drop SQLite columns (~2.4).", 
      "fzaninotto/faker": "Required to use the eloquent factory builder (~1.4).", 
      "guzzlehttp/guzzle": "Required to use the Mailgun and Mandrill mail drivers and the ping methods on schedules (~5.3|~6.0).", 
      "league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (~1.0).", 
      "league/flysystem-rackspace": "Required to use the Flysystem Rackspace driver (~1.0).", 
      "pda/pheanstalk": "Required to use the beanstalk queue driver (~3.0).", 
      "predis/predis": "Required to use the redis cache and queue drivers (~1.0).", 
      "pusher/pusher-php-server": "Required to use the Pusher broadcast driver (~2.0).", 
      "symfony/css-selector": "Required to use some of the crawler integration testing tools (3.1.*).", 
      "symfony/dom-crawler": "Required to use most of the crawler integration testing tools (3.1.*).", 
      "symfony/psr-http-message-bridge": "Required to use psr7 bridging features (0.2.*)." 
     }, 
     "type": "library", 
     "extra": { 
      "branch-alias": { 
       "dev-master": "5.3-dev" 
      } 
     }, 

有什麼不對?

非常感謝您的幫助。

+0

你有哪些PHP版本? – C2486

+0

在'composer update'之前嘗試'composer install',如果仍然不起作用,請刪除供應商並重新執行 – apokryfos

+0

Php版本:5.6.30 – ratm

回答

0

它適用於:

composer require laravel/framework:^5.4.0 --update-with-dependencies 
1

不是編輯composer.json的,嘗試運行

composer require laravel/laravel:^5.4.0 --update-with-dependencies 

僅供參考,請參閱https://getcomposer.org/doc/03-cli.md#require

- 更新與依賴關係:還更新新需要的包的依賴關係。

注意有很少的理由手動修改composer.json,尤其是沒有相應的命令都可用。

+0

'composer.json'不是冬青聖盃。編輯該文件併發出'composer'命令以在更改後重新處理它是安全的。 –

+0

取決於a)你究竟做了什麼,以及b)通過* safe *瞭解你的理解。 – localheinz

+0

它不起作用,但有錯誤日誌: – ratm

0

它不工作,但有錯誤日誌:

composer require laravel/laravel:^5.4.0 --update-with-dependencies 
./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 
    - The requested package laravel/laravel No version set (parsed as 1.0.0) is satisfiable by laravel/laravel[No version set (parsed as 1.0.0)] but these conflict with your requirements or minimum-stability. 
    Problem 2 
    - laravel/laravel v5.5.0 requires php >=7.0.0 -> your PHP version (5.6.30) does not satisfy that requirement. 
    - laravel/laravel v5.4.9 requires laravel/framework 5.4.* -> satisfiable by laravel/framework[5.4.x-dev, v5.4.0, v5.4.1, v5.4.10, v5.4.11, v5.4.12, v5.4.13, v5.4.14, v5.4.15, v5.4.16, v5.4.17, v5.4.18, v5.4.19, v5.4.2, v5.4.20, v5.4.21, v5.4.22, v5.4.23, v5.4.24, v5.4.25, v5.4.26, v5.4.27, v5.4.28, v5.4.29, v5.4.3, v5.4.30, v5.4.31, v5.4.32, v5.4.33, v5.4.34, v5.4.35, v5.4.36, v5.4.4, v5.4.5, v5.4.6, v5.4.7, v5.4.8, v5.4.9] but these conflict with your requirements or minimum-stability. 
    - laravel/laravel v5.4.30 requires laravel/framework 5.4.* -> satisfiable by laravel/framework[5.4.x-dev, v5.4.0, v5.4.1, v5.4.10, v5.4.11, v5.4.12, v5.4.13, v5.4.14, v5.4.15, v5.4.16, v5.4.17, v5.4.18, v5.4.19, v5.4.2, v5.4.20, v5.4.21, v5.4.22, v5.4.23, v5.4.24, v5.4.25, v5.4.26, v5.4.27, v5.4.28, v5.4.29, v5.4.3, v5.4.30, v5.4.31, v5.4.32, v5.4.33, v5.4.34, v5.4.35, v5.4.36, v5.4.4, v5.4.5, v5.4.6, v5.4.7, v5.4.8, v5.4.9] but these conflict with your requirements or minimum-stability. 
    - laravel/laravel v5.4.3 requires laravel/framework 5.4.* -> satisfiable by laravel/framework[5.4.x-dev, v5.4.0, v5.4.1, v5.4.10, v5.4.11, v5.4.12, v5.4.13, v5.4.14, v5.4.15, v5.4.16, v5.4.17, v5.4.18, v5.4.19, v5.4.2, v5.4.20, v5.4.21, v5.4.22, v5.4.23, v5.4.24, v5.4.25, v5.4.26, v5.4.27, v5.4.28, v5.4.29, v5.4.3, v5.4.30, v5.4.31, v5.4.32, v5.4.33, v5.4.34, v5.4.35, v5.4.36, v5.4.4, v5.4.5, v5.4.6, v5.4.7, v5.4.8, v5.4.9] but these conflict with your requirements or minimum-stability. 
    - laravel/laravel v5.4.23 requires laravel/framework 5.4.* -> satisfiable by laravel/framework[5.4.x-dev, v5.4.0, v5.4.1, v5.4.10, v5.4.11, v5.4.12, v5.4.13, v5.4.14, v5.4.15, v5.4.16, v5.4.17, v5.4.18, v5.4.19, v5.4.2, v5.4.20, v5.4.21, v5.4.22, v5.4.23, v5.4.24, v5.4.25, v5.4.26, v5.4.27, v5.4.28, v5.4.29, v5.4.3, v5.4.30, v5.4.31, v5.4.32, v5.4.33, v5.4.34, v5.4.35, v5.4.36, v5.4.4, v5.4.5, v5.4.6, v5.4.7, v5.4.8, v5.4.9] but these conflict with your requirements or minimum-stability. 
    - laravel/laravel v5.4.21 requires laravel/framework 5.4.* -> satisfiable by laravel/framework[5.4.x-dev, v5.4.0, v5.4.1, v5.4.10, v5.4.11, v5.4.12, v5.4.13, v5.4.14, v5.4.15, v5.4.16, v5.4.17, v5.4.18, v5.4.19, v5.4.2, v5.4.20, v5.4.21, v5.4.22, v5.4.23, v5.4.24, v5.4.25, v5.4.26, v5.4.27, v5.4.28, v5.4.29, v5.4.3, v5.4.30, v5.4.31, v5.4.32, v5.4.33, v5.4.34, v5.4.35, v5.4.36, v5.4.4, v5.4.5, v5.4.6, v5.4.7, v5.4.8, v5.4.9] but these conflict with your requirements or minimum-stability. 
    - laravel/laravel v5.4.19 requires laravel/framework 5.4.* -> satisfiable by laravel/framework[5.4.x-dev, v5.4.0, v5.4.1, v5.4.10, v5.4.11, v5.4.12, v5.4.13, v5.4.14, v5.4.15, v5.4.16, v5.4.17, v5.4.18, v5.4.19, v5.4.2, v5.4.20, v5.4.21, v5.4.22, v5.4.23, v5.4.24, v5.4.25, v5.4.26, v5.4.27, v5.4.28, v5.4.29, v5.4.3, v5.4.30, v5.4.31, v5.4.32, v5.4.33, v5.4.34, v5.4.35, v5.4.36, v5.4.4, v5.4.5, v5.4.6, v5.4.7, v5.4.8, v5.4.9] but these conflict with your requirements or minimum-stability. 
    - laravel/laravel v5.4.16 requires laravel/framework 5.4.* -> satisfiable by laravel/framework[5.4.x-dev, v5.4.0, v5.4.1, v5.4.10, v5.4.11, v5.4.12, v5.4.13, v5.4.14, v5.4.15, v5.4.16, v5.4.17, v5.4.18, v5.4.19, v5.4.2, v5.4.20, v5.4.21, v5.4.22, v5.4.23, v5.4.24, v5.4.25, v5.4.26, v5.4.27, v5.4.28, v5.4.29, v5.4.3, v5.4.30, v5.4.31, v5.4.32, v5.4.33, v5.4.34, v5.4.35, v5.4.36, v5.4.4, v5.4.5, v5.4.6, v5.4.7, v5.4.8, v5.4.9] but these conflict with your requirements or minimum-stability. 
    - laravel/laravel v5.4.15 requires laravel/framework 5.4.* -> satisfiable by laravel/framework[5.4.x-dev, v5.4.0, v5.4.1, v5.4.10, v5.4.11, v5.4.12, v5.4.13, v5.4.14, v5.4.15, v5.4.16, v5.4.17, v5.4.18, v5.4.19, v5.4.2, v5.4.20, v5.4.21, v5.4.22, v5.4.23, v5.4.24, v5.4.25, v5.4.26, v5.4.27, v5.4.28, v5.4.29, v5.4.3, v5.4.30, v5.4.31, v5.4.32, v5.4.33, v5.4.34, v5.4.35, v5.4.36, v5.4.4, v5.4.5, v5.4.6, v5.4.7, v5.4.8, v5.4.9] but these conflict with your requirements or minimum-stability. 
    - laravel/laravel v5.4.0 requires laravel/framework 5.4.* -> satisfiable by laravel/framework[5.4.x-dev, v5.4.0, v5.4.1, v5.4.10, v5.4.11, v5.4.12, v5.4.13, v5.4.14, v5.4.15, v5.4.16, v5.4.17, v5.4.18, v5.4.19, v5.4.2, v5.4.20, v5.4.21, v5.4.22, v5.4.23, v5.4.24, v5.4.25, v5.4.26, v5.4.27, v5.4.28, v5.4.29, v5.4.3, v5.4.30, v5.4.31, v5.4.32, v5.4.33, v5.4.34, v5.4.35, v5.4.36, v5.4.4, v5.4.5, v5.4.6, v5.4.7, v5.4.8, v5.4.9] but these conflict with your requirements or minimum-stability. 
    - Installation request for laravel/laravel ^5.4.0 -> satisfiable by laravel/laravel[v5.4.0, v5.4.15, v5.4.16, v5.4.19, v5.4.21, v5.4.23, v5.4.3, v5.4.30, v5.4.9, v5.5.0]. 
0

我曾通過編輯幾個文件一些細微的變化轉換laravel項目從5.3到5.4

+0

請詳細說明您在哪些文件中進行了哪些更改。 – contradictioned