DiscordPHP icon indicating copy to clipboard operation
DiscordPHP copied to clipboard

Error on installation in Laravel project, using PHP 8.3

Open abobus-2288 opened this issue 1 year ago • 4 comments

Environment

  • PHP Version:
    • 8.3.6
  • DiscordPHP Version:
    • Latest (7.3.5)

Trying to install DiscordPHP into freshly created Laravel^11 project that runs on PHP^8.3.6, but getting this error:

` Your requirements could not be resolved to an installable set of packages.

Problem 1 - team-reflex/discord-php v1.0.0 requires php ^5.5.9 -> your php version (8.3.6) does not satisfy that requirement. - team-reflex/discord-php[v2.0.0, ..., v2.1.3, v3.0.0, ..., v3.2.4] require guzzlehttp/guzzle ~5.3|~6.0 -> found guzzlehttp/guzzle[5.3.0, ..., 5.3.4, 6.0.0, ..., 6.5.8] but the package is fixed to 7.8.1 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command. - team-reflex/discord-php[v4.0.0, ..., v4.0.4] require php ^5.6|^7.0 -> your php version (8.3.6) does not satisfy that requirement. - team-reflex/discord-php[v5.0.0, ..., v5.0.3] require php ^7.0 -> your php version (8.3.6) does not satisfy that requirement. - team-reflex/discord-php[v5.0.10, ..., v5.0.12] require php ^7.2 -> your php version (8.3.6) does not satisfy that requirement. - team-reflex/discord-php[v5.1.0, ..., v5.1.3, v6.0.0, ..., v6.0.3, v7.0.0, ..., v7.3.5] require nesbot/carbon ^2.38 -> found nesbot/carbon[2.38.0, ..., 2.72.5] but the package is fixed to 3.5.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command. - Root composer.json requires team-reflex/discord-php * -> satisfiable by team-reflex/discord-php[v1.0.0, v2.0.0, ..., v2.1.3, v3.0.0, ..., v3.2.4, v4.0.0, ..., v4.0.4, v5.0.0, ..., v5.1.3, v6.0.0, v6.0.1, v6.0.2, v6.0.3, v7.0.0, ..., v7.3.5]. `

To Reproduce

composer create-project laravel/laravel discord-test && composer require team-reflex/discord-php

abobus-2288 avatar Jun 06 '24 16:06 abobus-2288

I'm not sure why your Composer is pulling version ^1.0.0 of DiscordPHP – are you providing a version constraint when requiring it? You could try requiring it with -W maybe?

For what it's worth, unless you have a very peculiar idea in mind, using DiscordPHP directly alongside a Laravel installation will provide little to no value. I highly suggest checking out https://laracord.com if you want to use DiscordPHP with Laravel features.

Log1x avatar Jun 06 '24 21:06 Log1x

His problem isn't that. DiscordPHP has no stable release, and composer is pulling the latest stable. He should require latest RC version.

And Laravel works fine with DiscordPHP. Laravel is ReactPHP compatible, like Symfony. Of course you can't run a ReactPHP app behind a webserver, but that doesn't make your statement correct either.

On Thu, 6 Jun 2024, 23:02 Brandon, @.***> wrote:

I'm not sure why your Composer is pulling version ^1.0.0 of DiscordPHP – are you providing a version constraint when requiring it?

For what it's worth, unless you have a very peculiar idea in mind, using DiscordPHP directly alongside a Laravel installation will provide little to no value. I highly suggest checking out https://laracord.com if you want to use DiscordPHP with Laravel features.

— Reply to this email directly, view it on GitHub https://github.com/discord-php/DiscordPHP/issues/1232#issuecomment-2153402969, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAE7SAOCZDV4QSTSDTVDHT3ZGDE6RAVCNFSM6AAAAABI5BWHDKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJTGQYDEOJWHE . You are receiving this because you are subscribed to this thread.Message ID: @.***>

shehi avatar Jun 06 '24 22:06 shehi

His problem isn't that. DiscordPHP has no stable release, and composer is pulling the latest stable. He should require latest RC version.

Good catch! I tunneled and didn't see that Composer was iterating through the available versions.

And Laravel works fine with DiscordPHP. Laravel is ReactPHP compatible, like Symfony. Of course you can't run a ReactPHP app behind a webserver, but that doesn't make your statement correct either.

Totally, I didn't say or suggest that it didn't. I was merely implying that if you are only installing DiscordPHP alongside Laravel to take advantage of Laravel-specific features without the need for a full blown web application, Laracord (or even Laravel Zero) would be worth taking a look at. Sorry for the confusion.

Log1x avatar Jun 06 '24 22:06 Log1x

For anyone who's having the same issue with php 8.3, using composer require team-reflex/discord-php -W (note -W option) works like a charm, like @Log1x recommended!

joao-pedro-alves avatar Jun 12 '24 00:06 joao-pedro-alves