iT邦幫忙

0

laravel 裝不起來

  • 分享至 

  • xImage

我照這個裝 https://pandalab.org/articles/90
這裡就出現問題
composer global require laravel/installer

C:\xampp\htdocs>composer self-update
You are already using the latest available Composer version 2.1.12 (stable channel).

C:\xampp\htdocs>composer global require laravel/installer
Changed current directory to C:/Users/Kevin/AppData/Roaming/Composer
Using version ^4.2 for laravel/installer
./composer.json has been updated
Running composer update laravel/installer
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - laravel/installer[v4.2.0, ..., v4.2.9] require symfony/console ^4.0|^5.0 -> satisfiable by symfony/console[v4.3.5].
    - symfony/console v4.3.5 requires php ^7.1.3 -> your php version (8.0.12) does not satisfy that requirement.
    - Root composer.json requires laravel/installer ^4.2 -> satisfiable by laravel/installer[v4.2.0, ..., v4.2.9].

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
You can also try re-running composer require with an explicit version constraint, e.g. "composer require laravel/installer:*" to figure out if any version is installable, or "composer require laravel/installer:^2.1" if you know which you need.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.

搜尋解決方法
composer update --ignore-platform-reqs

Loading composer repositories with package information
Updating dependencies
Nothing to modify in lock file
Installing dependencies from lock file (including require-dev)
Nothing to install, update or remove
Generating autoload files
看更多先前的討論...收起先前的討論...
fillano iT邦超人 1 級 ‧ 2021-11-22 15:29:51 檢舉
--ignore-platform-reqs參數可以加在composer global require命令中嗎?
你安裝三次要幹嘛呢,不太懂樓主要幹嘛
我才疏學淺 只看得懂你的php版本太高
- symfony/console v4.3.5 requires php ^7.1.3 -> your php version (8.0.12) does not satisfy that requirement.

他看起來要php7.1.3以上 沒有要php8

他有建議composer require laravel/installer:^2.1 你可以試試看
alex9453 iT邦新手 2 級 ‧ 2021-11-22 21:01:36 檢舉
我一直裝不起來 , http://127.0.0.1:8000 都無法執行 , 才會裝三次 , 還是我移除再裝看看
alex9453 iT邦新手 2 級 ‧ 2021-11-22 22:38:42 檢舉
還是裝不起來

c:\xampp\php>composer global require "laravel/installer"
Changed current directory to C:/Users/Kevin/AppData/Roaming/Composer
Using version ^4.2 for laravel/installer
./composer.json has been updated
Running composer update laravel/installer
Loading composer repositories with package information
Updating dependencies
Nothing to modify in lock file
Installing dependencies from lock file (including require-dev)
Nothing to install, update or remove
Generating autoload files
11 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
fillano iT邦超人 1 級 ‧ 2021-11-23 08:45:58 檢舉
移除然後加上--with-all-dependencies參數來裝裝看(一開始的錯誤提示就有寫)。我把php換成8來試裝並沒問題,裝上的laravel/installer是4.2.9,搭配的symfony/console是5.3.11,看起來問題出在symfony/console的版本無法跟你的php版本搭配的樣子。也許讓composer根據需要去昇/降級版本就可以成功(錯誤提示也是這樣說)。
alex9453 iT邦新手 2 級 ‧ 2021-11-23 15:33:01 檢舉
我的PHP Version 8.0.12
C:\Users\Kevin>laravel -V
Laravel Installer 4.2.9

C:\Users\Kevin>composer require symfony/console
Using version ^5.3 for symfony/console
./composer.json has been updated
Running composer update symfony/console
Loading composer repositories with package information
Updating dependencies
Nothing to modify in lock file
Installing dependencies from lock file (including require-dev)
Nothing to install, update or remove
Generating autoload files
10 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
請問用 composer fund 打什麼指令可以昇或降級
建議用linux 環境安裝k8s,然後容器化開一個laravel環境出來
這樣會比較快,而且容器化是未來的趨勢,早接觸晚接觸都要接觸
趁早打底會比較好
composer fund 是用來看哪個package現在再找贊助

請嘗試composer require laravel/installer:^4.2
alex9453 iT邦新手 2 級 ‧ 2021-11-24 15:10:28 檢舉
我是 win 10 , 要先裝 virtuxbox + centos + k8s + php + mysql + + composer + laravel , 順序是這樣嗎
alex9453 iT邦新手 2 級 ‧ 2021-11-24 16:04:17 檢舉
網路有怎麼裝的教學嗎 ? 謝謝
只需要裝 virtuxbox + centos + php + composer + laravel
windows也可以用wsl去跑ubuntu,但裡面還是有不少坑拉
等你laravel能用 再來安裝剩餘的部分
要怎麼裝請自己谷哥喔
我是用virtualbox裝linux,在上面使用laradock,自己開發使用上很夠用
alex9453 iT邦新手 2 級 ‧ 2021-11-30 22:51:49 檢舉
我現在 win 10 + vmware + ubuntu , 但執行起來會遲鈍 , 我的 ram 只有 4 G , 是不是該加 ram
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

1 個回答

1
chun8106
iT邦新手 5 級 ‧ 2021-11-23 11:13:29

應該是PHP 版本問題

     -laravel/installer[v4.2.0, ..., v4.2.9] require symfony/console ^4.0|^5.0 -> satisfiable by symfony/console[v4.3.5].
     -symfony/console v4.3.5 requires php ^7.1.3 -> your php version (8.0.12) does not satisfy that requirement.
     -Root composer.json requires laravel/installer ^4.2 -> satisfiable by laravel/installer[v4.2.0, ..., v4.2.9].

安裝Laravel 4.2 要PHP 5.4 以上版本。

Server Requirements
The Laravel framework has a few system requirements:

PHP >= 5.4
MCrypt PHP Extension

ref:
https://laravel.com/docs/4.2

看更多先前的回應...收起先前的回應...
chun8106 iT邦新手 5 級 ‧ 2021-11-23 11:15:39 檢舉

PHP 版本不能太新不能太舊,個人建議用5.4就好!

alex9453 iT邦新手 2 級 ‧ 2021-11-23 14:11:44 檢舉

謝謝答覆 , 原來太新還不行 , 我去下載 5.4 卻無法下載 , 是這個網頁嗎 ?
https://ithelp.ithome.com.tw/upload/images/20211123/20104326wHEaECQj3S.png

alex9453 iT邦新手 2 級 ‧ 2021-11-23 14:45:15 檢舉

phph5.42 可以用在 windows 下嗎 ? 他沒有 php.exe 執行檔 , 搜尋網路找不到怎麼裝
https://ithelp.ithome.com.tw/upload/images/20211123/20104326jvSlZQXW7O.png

chun8106 iT邦新手 5 級 ‧ 2021-11-24 09:55:51 檢舉

我找到這個希望幫到你。

https://prototype.php.net/versions/5.6.20/

alex9453 iT邦新手 2 級 ‧ 2021-11-25 14:58:40 檢舉

謝謝

chun8106 iT邦新手 5 級 ‧ 2021-11-25 15:36:00 檢舉

成功了?

alex9453 iT邦新手 2 級 ‧ 2021-11-25 15:45:14 檢舉

我還在 virtualbox 上裝 centos 8 中

chun8106 iT邦新手 5 級 ‧ 2021-11-25 15:56:47 檢舉

加油!

alex9453 iT邦新手 2 級 ‧ 2021-12-02 10:53:30 檢舉

請問安裝 laravel 4.2 , 指令要怎麼下

composer global require laravel/installer
Changed current directory to C:/Users/Kevin/AppData/Roaming/Composer
Using version ^4.2 for laravel/installer
./composer.json has been updated
Running composer update laravel/installer
Loading composer repositories with package information
Updating dependencies
Nothing to modify in lock file
Installing dependencies from lock file (including require-dev)
Nothing to install, update or remove
Generating autoload files
11 packages you are using are looking for funding.
Use the `composer fund` command to find out more!

我要發表回答

立即登入回答