snipe-it icon indicating copy to clipboard operation
snipe-it copied to clipboard

Unable to Install using PHP 8

Open ajohnson6494 opened this issue 5 years ago • 10 comments

ajohnson6494 avatar Dec 21 '20 18:12 ajohnson6494

👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

welcome[bot] avatar Dec 21 '20 18:12 welcome[bot]

Our suggestion for right now would be to downgrade PHP. I don't believe we've tested this on PHP8 yet.

@uberbrady have you tested installations at all with PHP8?

snipe avatar Dec 21 '20 21:12 snipe

No, I haven't tested it at all. I suspect it may require a Laravel version bump though; I think Laravel only very recently got compatibility with PHP 8 working.

uberbrady avatar Dec 21 '20 21:12 uberbrady

The First error can easy be solved by run composer update this will give you some yellow notices afther the update is finished:

Package doctrine/reflection is abandoned, you should avoid using it. Use roave/better-reflection instead. Package patchwork/utf8 is abandoned, you should avoid using it. Use symfony/polyfill-mbstring or symfony/string instead. Package fzaninotto/faker is abandoned, you should avoid using it. No replacement was suggested. Package phpunit/php-token-stream is abandoned, you should avoid using it. No replacement was suggested.

real problem starts when you try to generate the key

php artisan key:generate
PHP Fatal error:  Declaration of Doctrine\DBAL\Driver\PDOConnection::query() must be compatible with PDO::query(string $query, ?int $fetchMode = null, mixed ...$fetchModeArgs) in C:\inetpub\wwwroot\snipe-it\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\PDOConnection.php on line 81

In PDOConnection.php line 81:

  Declaration of Doctrine\DBAL\Driver\PDOConnection::query() must be compatible with PDO::query(string $query, ?int $
  fetchMode = null, mixed ...$fetchModeArgs)
```
`
so guess until this is fixed only way is to use php 7x


fireballhh avatar Jan 20 '21 07:01 fireballhh

I am having the same issue. I update to php8 because some other projects needs it. Is there a work around for the error?

PHP Fatal error: Declaration of Doctrine\DBAL\Driver\PDOConnection::query() must be compatible with PDO::query(string $query, ?int $fetchMode = null, mixed ...$fetchModeArgs) in C:\inetpub\wwwroot\snipe-it\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\PDOConnection.php on line 81

In PDOConnection.php line 81:

Declaration of Doctrine\DBAL\Driver\PDOConnection::query() must be compatible with PDO::query(string $query, ?int $ fetchMode = null, mixed ...$fetchModeArgs)

nyamoga9 avatar Jan 28 '21 08:01 nyamoga9

I am having the same issue. I update to php8 because some other projects needs it. Is there a work around for the error?

PHP Fatal error: Declaration of Doctrine\DBAL\Driver\PDOConnection::query() must be compatible with PDO::query(string $query, ?int $fetchMode = null, mixed ...$fetchModeArgs) in C:\inetpub\wwwroot\snipe-it\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\PDOConnection.php on line 81

In PDOConnection.php line 81:

Declaration of Doctrine\DBAL\Driver\PDOConnection::query() must be compatible with PDO::query(string $query, ?int $ fetchMode = null, mixed ...$fetchModeArgs)

same problem here

ajsy avatar Jan 31 '21 10:01 ajsy

@ajohnson6494 they would be using the one we specify in composer.lock. If you're running ^3.0, I'm glad it seems to be working, but it also means you ran composer update which you should never do. We generate the composer.lock file so that we can be sure that all dependencies have been tested and accounted for, and you don't get stuck on an edge case bug because you happen to be three point releases ahead or behind in a particular library. You should only be running composer install.

snipe avatar Feb 03 '21 00:02 snipe

@ajohnson6494 Yes, thank you, I'm aware of how composer works. My point is that telling people to mess with compose, especially if they're not developers and don't expect to be submitting PRs to increase compatibility, is bad news and will cause the other users and us a lot of headache.

DBAL version 3 requires at least PHP 7.3, which is higher than our minimum PHP requirement (which is why it's not been pulled forward yet.) We don't change PHP requirements outside of (typically) major releases or at the very least a minor release.

If you want to mess with composer.json, be my guest, but understand that it means our ability to help you with things moving forward will be greatly hindered if not impossible.

snipe avatar Feb 03 '21 19:02 snipe

Snipe-IT works well with PHP 8.0.3 o XAMPP. The only problem I'm facing is LDAP Sync not working. It gives 500 Server Error.

image

I enabled debugging and found out I'm having same errors in laravel.logs as mentioned in Issue #3319

Do I need to downgrade my PHP Version?

mfsid avatar May 09 '21 15:05 mfsid

I can’t answer that without knowing what the logs say, but either way it should probably be a new ticket. We’ve had many releases since the original ticket was closed.

snipe avatar May 09 '21 15:05 snipe