Before asking for help please read "Requesting Help and Suggestions" by clicking on that tab above here.
  • Page:
  • 1

TOPIC:

PHP error after 1.7>2.0 upgrade 1 month 3 weeks ago #1

  • nycvelo
  • nycvelo's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 3
FreeBSD 13.0-RELEASE-p3, php7.3, apache 2.4.48, webtrees 2.0.16

After manually upgrading from webtrees 1.7.13 to 2.0.16, loading the home page fails with this error:

[Sat Jul 24 20:54:16.553156 2021] [php7:error] [pid 88415] [client x.x.x.x:55013] PHP Fatal error: Uncaught Error: Call to undefined method Fisharebest\\Webtrees\\Filter::server() in /usr/local/www/webtrees/includes/session.php:167\nStack trace:\n#0 /usr/local/www/webtrees/login.php(30): require()\n#1 {main}\n thrown in /usr/local/www/webtrees/includes/se

The server does have the php73-filter module installed, and the site is configured to use pretty URLs. Also, Apache is configured to redirect requests for this URL:

arbor.potrzebie.org

to this URL:

arbor.potrzebie.org/webtrees/login.php

Thanks in advance for clues on troubleshooting and fixing this error.

Please Log in or Create an account to join the conversation.

Last edit: by nycvelo.

PHP error after 1.7>2.0 upgrade 1 month 3 weeks ago #2

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 14861
> Also, Apache is configured to redirect requests for this URL:
> arbor.potrzebie.org
> to this URL:
> arbor.potrzebie.org/webtrees/login.php

1) This is the *old* login URL from webtrees 1.x. The new URL would be just /webtrees/login

This is probably not necessary. If you set your tree's privacy to be "Show to members", then webtrees will automatically redirect to the login page when you visit the site.
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

PHP error after 1.7>2.0 upgrade 1 month 3 weeks ago #3

  • nycvelo
  • nycvelo's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 3

> Also, Apache is configured to redirect requests for this URL:
> arbor.potrzebie.org
> to this URL:
> arbor.potrzebie.org/webtrees/login.php

1) This is the *old* login URL from webtrees 1.x. The new URL would be just /webtrees/login


That URL returns a not-found error.

The Apache redirect is now:

DocumentRoot "/usr/local/www/webtrees"
RedirectMatch ^/$ arbor.potrzebie.org/webtrees/login

And config.ini.php includes these settings:

base_url="arbor.potrzebie.org"
rewrite_urls="1"

This is probably not necessary. If you set your tree's privacy to be "Show to members", then webtrees will automatically redirect to the login page when you visit the site.


Am currently unable to set this due to the login problem noted above. Thanks in advance for other troubleshooting clues, and please let me know if you need other info about this server's setup.

Please Log in or Create an account to join the conversation.

Last edit: by nycvelo.

PHP error after 1.7>2.0 upgrade 1 month 3 weeks ago #4

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 14861
I'm guessing there is an issue with your apache rewrite rules.

Trying random URLs gives an apache 404 - not a webtrees 404 - suggesting that the rewrite rules are not passing the request to the webtrees scripts.

I would disable all these, (and change rewrite_urls back to "0").
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

PHP error after 1.7>2.0 upgrade 1 month 3 weeks ago #5

  • nycvelo
  • nycvelo's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 3

I'm guessing there is an issue with your apache rewrite rules.

Trying random URLs gives an apache 404 - not a webtrees 404 - suggesting that the rewrite rules are not passing the request to the webtrees scripts.

I would disable all these, (and change rewrite_urls back to "0").


That did the trick. Thank you!

The two changes were disabling the RedirectMatch rule in the Apache config file, and setting rewrite_urls set to 0 in the Webtrees config.ini.php file. Thanks again!

Please Log in or Create an account to join the conversation.

PHP error after 1.7>2.0 upgrade 6 days 12 hours ago #6

I have a very similar issue. I love 1.7 (what I don't like in 2.0 is the narrow page look) - but seeing that it's end of life I decided to try and upgrade.
As I'm afraid of this change I'm doing it all locally on my PC before attempting this on the server.
1. Backed up my server DB and /data folder.
2. Installed 1.7.16 (the version I have on the server) locally and restored my DB backup and data folder -> 1.7.16 works OK locally.
3. Upgraded to 1.7.18 locally -> 1.7.18 works OK locally.
4. Upgraded to 2.0.18 locally.
At this point, going to the app index page gives me this error:

ErrorException: Declaration of Fisharebest\Webtrees\Header::getInstance(string $xref, Fisharebest\Webtrees\Tree $tree, ?string $gedcom = NULL): ?Fisharebest\Webtrees\Header should be compatible with Fisharebest\Webtrees\GedcomRecord::getInstance($xref, Fisharebest\Webtrees\Tree $tree, $gedcom = NULL) in /vhosts/familia/app/Header.php:80 Stack trace: #0 /vhosts/familia/vendor/composer/ClassLoader.php(478): Fisharebest\Webtrees\Webtrees::Fisharebest\Webtrees\{closure}(2, 'Declaration of ...', '/vhosts/familia...', 80, Array) #1 /vhosts/familia/vendor/composer/ClassLoader.php(478): include() #2 /vhosts/familia/vendor/composer/ClassLoader.php(346): Composer\Autoload\includeFile('/vhosts/familia...') #3 [internal function]: Composer\Autoload\ClassLoader->loadClass('Fisharebest\\Web...') #4 /vhosts/familia/app/Http/Middleware/RegisterFactories.php(62): spl_autoload_call('Fisharebest\\Web...') #5 /vhosts/familia/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\RegisterFactories->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #6 /vhosts/familia/vendor/middlewares/client-ip/src/ClientIp.php(81): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest)) #7 /vhosts/familia/app/Http/Middleware/ClientIp.php(47): Middlewares\ClientIp->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #8 /vhosts/familia/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\ClientIp->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #9 /vhosts/familia/app/Http/Middleware/HandleExceptions.php(90): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest)) #10 /vhosts/familia/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\HandleExceptions->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #11 /vhosts/familia/app/Http/Middleware/BaseUrl.php(77): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest)) #12 /vhosts/familia/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\BaseUrl->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #13 /vhosts/familia/app/Http/Middleware/ReadConfigIni.php(69): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest)) #14 /vhosts/familia/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\ReadConfigIni->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #15 /vhosts/familia/app/Http/Middleware/SecurityHeaders.php(48): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest)) #16 /vhosts/familia/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\SecurityHeaders->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #17 /vhosts/familia/app/Http/Middleware/EmitResponse.php(57): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest)) #18 /vhosts/familia/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\EmitResponse->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #19 /vhosts/familia/app/Http/Middleware/PhpEnvironment.php(49): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest)) #20 /vhosts/familia/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\PhpEnvironment->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #21 /vhosts/familia/vendor/oscarotero/middleland/src/Dispatcher.php(118): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest)) #22 /vhosts/familia/index.php(57): Middleland\Dispatcher->dispatch(Object(Nyholm\Psr7\ServerRequest)) #23 {main}

Configuration:
MariaDB, Php-Fpm 7.3.30, Nginx

Can someone offer some advice on this?

Thanks,
Miron

Please Log in or Create an account to join the conversation.

PHP error after 1.7>2.0 upgrade 5 days 19 hours ago #7

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 14861
It looks like you have a mix of files from different versions of webtrees.

Try copying all the 2.0 files again.
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Powered by Kunena Forum