Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please make known work with PHP version 8 #3096

Closed
pebbe opened this issue Jun 26, 2022 · 19 comments
Closed

Please make known work with PHP version 8 #3096

pebbe opened this issue Jun 26, 2022 · 19 comments
Milestone

Comments

@pebbe
Copy link

pebbe commented Jun 26, 2022

While trying to do this:

./known.php

I encountered this error:

PHP Fatal error:  During inheritance of SessionHandlerInterface: Uncaught ArgumentCountError: Too few arguments to function Idno\Core\Logging::Idno\Core\{closure}(), 4 passed in /var/www/html/blog/vendor/symfony/http-foundation/Session/Storage/Handler/AbstractSessionHandler.php on line 23 and exactly 5 expected in /var/www/html/blog/Idno/Core/Logging.php:40
Stack trace:
#0 /var/www/html/blog/vendor/symfony/http-foundation/Session/Storage/Handler/AbstractSessionHandler.php(23): Idno\Core\Logging->Idno\Core\{closure}()
#1 /var/www/html/blog/vendor/composer/ClassLoader.php(444): include('...')
#2 /var/www/html/blog/vendor/composer/ClassLoader.php(322): Composer\Autoload\includeFile()
#3 /var/www/html/blog/vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php(41): Composer\Autoload\ClassLoader->loadClass()
#4 /var/www/html/blog/vendor/composer/ClassLoader.php(444): include('...')
#5 /var/www/html/blog/vendor/composer/ClassLoader.php(322): Composer\Autoload\includeFile()
#6 /var/www/html/blog/Idno/Data/AbstractSQL.php(87): Composer\Autoload\ClassLoader->loadClass()
#7 /var/www/html/blog/Idno/Core/Session.php(46): Idno\Data\AbstractSQL->handleSession()
#8 /var/www/html/blog/Idno/Common/Component.php(18): Idno\Core\Session->init()
#9 /var/www/html/blog/Idno/Core/Idno.php(117): Idno\Common\Component->__construct()
#10 /var/www/html/blog/Idno/Common/Component.php(18): Idno\Core\Idno->init()
#11 /var/www/html/blog/Idno/Core/Idno.php(45): Idno\Common\Component->__construct()
#12 /var/www/html/blog/known.php(30): Idno\Core\Idno->__construct()
#13 {main} in /var/www/html/blog/vendor/symfony/http-foundation/Session/Storage/Handler/AbstractSessionHandler.php on line 23

Some other notes:

php version:

PHP 8.1.2 (cli) (built: Jun 13 2022 13:52:54) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.2, Copyright (c) Zend Technologies
    with Zend OPcache v8.1.2, Copyright (c), by Zend Technologies

Give us some context:

  • It'd also be really handy if you could tell us the contents of your version.known file
version = '1.2.2'
build = 2020061101
revision = "bd43456"
  • What database are you using? (e.g. mongo, mysql, postgres)

mysql

  • Any warnings or errors in your admin/diagnostics page?

Browser gets HTTP ERROR 500

  • If this is a programming bug, can you include examples of any Micropub / API calls / webhook pings you make? Otherwise please don't worry about what this means!
  • Bonus points - are you able to illustrate the issue with a unit test? If so, submit it as a pull request!
@Wunderharke
Copy link

This would be important for me as well. Is this project still actively maintained?

@thierrymarianne
Copy link
Contributor

Fyi, I've been running known as a personal site instance for a while now with PHP 8.1.8 without encountering much of comparable issues.

Here is the content of my version.known file if that may be of help

version = '1.3.1'
build = 2020120201

@Wunderharke
Copy link

@thierrymarianne thanks for your quick response. My problem is that composer isn't able to install the necessary packages. How did you solve that? Could you share your composer.json?

@thierrymarianne
Copy link
Contributor

thierrymarianne commented Aug 4, 2022

Good day @Wunderharke, here is the composer.json I'm using:

It's compatible with composer:2.3 Docker container image.

@Wunderharke
Copy link

I didn't get your composer.json working with my version of composer. But I tried the dev branch instead of the latest release tag, and it is working out of the box with composer and PHP 8.

@thierrymarianne
Copy link
Contributor

Sorry to hear about the incompatibilities between your composer version and this file.
Glad to know that something worked eventually.

@lindner
Copy link
Collaborator

lindner commented Sep 24, 2022

We should tag a release, then we can mark this as fixed.

@thierrymarianne
Copy link
Contributor

Definitely! It would help with issues triaging.

@lindner lindner added this to the 1.5 milestone Oct 8, 2022
@thierrymarianne
Copy link
Contributor

Please note that I could not reproduce the FatalError mentioned in this issue description
by running php known.php with php 8.1.11 as described in #3109 (reply in thread)

@benwerd
Copy link
Member

benwerd commented Oct 11, 2022 via email

@lindner
Copy link
Collaborator

lindner commented Nov 28, 2022

Current dev branch works on php 8. Version 1.5 targets 8.1

@AmritasyaPutra
Copy link

We should tag a release, then we can mark this as fixed.

Hoping that it happens sometime soon!

@thierrymarianne
Copy link
Contributor

Soon after taking care of #3109 (reply in thread), I've got to say that I got a bit lost in the process of figuring what was the next priority in order to help making the release happen.

Thank you @AmritasyaPutra for reviving the thread.

I wonder which criteria would help us close this issue.🤔

Perhaps, moving the build from travis to GitHub actions and
adding PHP 8.1 to the PHP version matrix?

@sikkdays
Copy link

I just followed the documentation for upgrading and I am now on 1.2.2 and switching to php 8.1 results in 500 Internal Server Error on shared hosting via DreamHost. Any advice?

During inheritance of SessionHandlerInterface: Uncaught ArgumentCountError: Too few arguments to function Idno\Core\Logging::Idno\Core\{closure}(), 4 passed in /home/site/vendor/symfony/http-foundation/Session/Storage/Handler/AbstractSessionHandler.php on line 23 and exactly 5 expected in /home/site/Idno/Core/Logging.php:40

@svandragt
Copy link

I suspect that documentation contains composer instructions so have you ran composer install or if that doesn't work composer update? A release would bundle all those project dependencies so that using composer wouldn't be required. (making a few assumptions here)

@benwerd
Copy link
Member

benwerd commented May 10, 2023

This has gone on for long enough. I commit to a new release on June 1.

However, for now: the core code in GitHub is fully tested on PHP 8.1.1. I'll make an effort to test on PHP 8.2 before release.

@sikkdays
Copy link

Thanks @benwerd ! Much appreciated.

@svandragt On the shared DreamHost account, install and upgrade of Known was always just dropping the files and folders on the server. I do have limited ssh access, so I can try the composer update and see if that helps. Upgrading to the developer version (1.3.1) got me a shiny new error--

Idno/Core/DataConcierge.php:184 - "Uncaught Error: Class "Ramsey\Uuid\Uuid" not found

I think you're correct that composer may be the issue here. Now, I just need to find some more evening time to try and update it.

@thierrymarianne
Copy link
Contributor

👋🏻

FYI, I've been running known with PHP 8.2.6 without issues - so far 🤞🏻
Besides, the application health is monitored with an APM generating regularly synthetic tests so that errors are not left unchecked for too long whenever a runtime upgrade happened before, new features or plugins have been rolled out.

Diagnostics also seems to be fine with it:
diag

P.S. If some are interested about how to run an known instance with Docker Compose (v2), guidelines for the documentation with code snipped could most likely be drafted at some point. I've got something working with nginx, mysql and taking care of building the assets (with grunt) and installing the vendors (with composer)

@benwerd
Copy link
Member

benwerd commented Oct 23, 2023

It does work on PHP 8.2; therefore, I'm closing this issue.

@benwerd benwerd closed this as completed Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants