This Help forum is for issues relates to the latest release (1.7.2). For issues related to beta or github version please use their own Help forum.
Before asking for help please read "How to request help" by clicking on that tab above here."
  • Page:
  • 1

TOPIC:

PHP 7 - webtrees is not running 5 years 7 months ago #1

  • HonkXL
  • HonkXL's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 167
Hi,
I just upgraded from PHP 5.6 to PHP 7. Most applications are working, but in webtrees I get an error message on the start page:
#0 unknown:unknown ErrorException("session_regenerate_id(): Failed to create(read) session ID: user (path: /var/lib/php5)")
#1 /app/Session.php:107 session_regenerate_id()
#2 /includes/session.php:417 regenerate()
#3 /index.php:31 require()

Is webtrees compatible with PHP7? Switching back to PHP 5.6 worked fine :-)

HonkXL

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

PHP 7 - webtrees is not running 5 years 7 months ago #2

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 14715
webtrees works fine on PHP7. I use it for development, and I plan to upgrade webtrees.net to use it soon.

Your problem appears to be that your server is using PHP7 - but with a PHP5 configuration file. Specifically, your PHP configuration probably contains the line

session.save_path = /var/lib/php5/

Either this folder does not exist, or your server does not have permission to write to it.

To check this, you could create a file (e.g. called "phpinfo.php") containing ("<?php phpinfo() ?>") and then switch to PHP7. You'll then be able to see all your PHP7 settings.
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.

Last edit: by fisharebest.

PHP 7 - webtrees is not running 5 years 7 months ago #3

  • HonkXL
  • HonkXL's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 167
Hi,

/var/lib/php5 exists. It belongs to user and group root and the permissions are set, that user, group and other have rights to read and write.
I already tried to set this path to a different path in the temp directory, but it did not work after this.

I am no programmer, but I found this:
bugs.php.net/bug.php?id=70871

Can this be related to this bug in any way?

My server runs with Plesk 12.5. So I can switch between PHP 5.6 and 7 on the GUI. When I switch back to 5.6 everything works fine.
I will still use 5.6 for this subdomain, but all other subdomains with wordpress and some other tools are running fine with PHP 7, ony Webtree makes troubles.

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

PHP 7 - webtrees is not running 5 years 7 months ago #4

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 14715
I haven't yet tried with 7.0 - just the beta/RC versions, so maybe there's been a slight change.

Can you try a simple change for me.

In includes/session.php, around line 371, change

return Database::prepare("SELECT session_data FROM `##session` WHERE session_id=?")->execute(array($id))->fetchOne();

to

return (string) Database::prepare("SELECT session_data FROM `##session` WHERE session_id=?")->execute(array($id))->fetchOne();

We're returning NULL when no data exists, rather than an empty string. The bug report you quoted says that PHP is giving a bogus error message in this case.
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 7 - webtrees is not running 5 years 7 months ago #5

  • HonkXL
  • HonkXL's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 167
Hi,

great - when I change this, it works fine with PHP 7. I will now change to PHP 7 and test it :-)

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

PHP 7 - webtrees is not running 5 years 7 months ago #6

  • HonkXL
  • HonkXL's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 167
up to now, everything seems to work fine with this small change. Maybe you can add this in the next update?

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

PHP 7 - webtrees is not running 5 years 7 months ago #7

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 14715

up to now, everything seems to work fine with this small change. Maybe you can add this in the next update?


I already did ;-)

github.com/fisharebest/webtrees/commit/f...b3d6f2b59906acee9b8e
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 7 - webtrees is not running 5 years 7 months ago #8

  • HonkXL
  • HonkXL's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 167
great. Thank you!

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

Do you need a web hosting solution for your webtrees site?
If you prefer a host that specialises in webtrees, the following page lists some suppliers able to provide one for you: 

[SOLVED] PHP 7 - webtrees is not running 5 years 7 months ago #9

  • HonkXL
  • HonkXL's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 167
Problem solved.

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

  • Page:
  • 1
Powered by Kunena Forum