Các thông báo lỗi chỉ ra một yêu cầu từ chính composer.json
. Yêu cầu phiên bản có thể chỉ là bộ chuyển đổi:
"require": {
"php": ">=5.5",
Sau khi thay đổi phiên bản như thế này tôi nhận được:
Problem 1
- Installation request for classpreloader/classpreloader 2.0.0 -> satisfiable by classpreloader/classpreloader[2.0.0].
- classpreloader/classpreloader 2.0.0 requires php >=5.5.9 -> your PHP version (5.5.6) or "config.platform.php" value does not satisfy that requirement.
Problem 2
- Installation request for laravel/framework v5.1.17 -> satisfiable by laravel/framework[v5.1.17].
- laravel/framework v5.1.17 requires php >=5.5.9 -> your PHP version (5.5.6) or "config.platform.php" value does not satisfy that requirement.
Problem 3
- Installation request for laravelcollective/html v5.1.6 -> satisfiable by laravelcollective/html[v5.1.6].
- laravelcollective/html v5.1.6 requires php >=5.5.9 -> your PHP version (5.5.6) or "config.platform.php" value does not satisfy that requirement.
Problem 4
- laravel/framework v5.1.17 requires php >=5.5.9 -> your PHP version (5.5.6) or "config.platform.php" value does not satisfy that requirement.
- jenssegers/agent v2.1.7 requires illuminate/support ~4.0|~5.0 -> satisfiable by laravel/framework[v5.1.17].
- Installation request for jenssegers/agent v2.1.7 -> satisfiable by jenssegers/agent[v2.1.7].
Sử dụng đoạn mã sau trong composer.json
, một phiên bản php thể được mô phỏng
[...]
"config": {
"preferred-install": "dist",
"platform": {
"php": "5.5.9"
}
}
Tài liệu: https://getcomposer.org/doc/06-config.md#platform
nền tảng
Cho phép bạn gói nền tảng giả (PHP và phần mở rộng) để bạn có thể mô phỏng một env sản xuất, xác định nền tảng mục tiêu của bạn trong config. Ví dụ: {"php": "5.4", "ext-something": "4.0"}.
Đừng quên để chạy một composer.phar update
sau này
Dự án Laravel may quyết định rằng họ tuyên bố phát hành 5.1 của họ tương thích với phiên bản PHP có sẵn lâu đời nhất họ có thể thử nghiệm với trên TravisCI, đó là 5.5.9. Một mặt, đây là một lựa chọn hợp lý. Mặt khác, nó là một rào cản không cần thiết đối với những người chạy trên các phiên bản cũ hơn của nhánh PHP 5.5, bởi vì không có sự thay đổi không tương thích ngược trong PHP 5.5 trước 5.5.9 - mã sẽ chạy. Vấn đề với '--ignore-platform-req' là nó ảnh hưởng đến TẤT CẢ các gói, bạn có thể nhận các gói chỉ chạy với PHP 5.6. – Sven