This Help forum is for issues relates to the latest release (1.7.5). 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."

TOPIC: PHP Error After Migrating to Ubuntu 16.04 LTS/PHP7

PHP Error After Migrating to Ubuntu 16.04 LTS/PHP7 1 year 1 month ago #1

  • moetjojo
  • moetjojo's Avatar
Hi, after migrating to 16.04.1 on a new server with PHP7, I copied all of my existing webtrees files from my previous server. I replicated the DB connection settings. I now get the following PHP error on my site index page:

#0 unknown:unknown ErrorException("session_regenerate_id(): Failed to create(read) session ID: user (path: /var/lib/php/sessions)")
#1 /app/Session.php:107 session_regenerate_id()
#2 /includes/session.php:417 regenerate()
#3 /index.php:31 require()
The administrator has disabled public write access.

PHP Error After Migrating to Ubuntu 16.04 LTS/PHP7 1 year 1 month ago #2

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Posts: 10712
It would appear that:

Your server is configured to store sessions in the folder /var/lib/php/sessions/
Your server is not configured to allow PHP scripts to read/write files in this folder.

You should investigate the permissions of this folder.

(The default PHP behaviour is to store sessions in files, like this. However, webtrees
overrides this default to store sessions in the database. Your server appears to be
ignoring this?)
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net
The administrator has disabled public write access.

PHP Error After Migrating to Ubuntu 16.04 LTS/PHP7 1 year 1 month ago #3

  • moetjojo
  • moetjojo's Avatar
Hi, this folder is writable.

drwx-wx-wt 2 root root 4096 Aug 10 12:19 sessions
ubuntu@ip-172-31-12-85:/var/lib/php$

Do you know where webtrees specifies to write to DB rather than files?

I found a similar issue on another application which appears to be down to how PHP7 handles a FALSE string, returning an error instead of returning as empty string. github.com/Inchoo/Inchoo_PHP7/issues/4

Unsure if this is related. All of my webtrees files contain no modification to the version working on my existing server running PHP5.

Thanks
The administrator has disabled public write access.

PHP Error After Migrating to Ubuntu 16.04 LTS/PHP7 1 year 1 month ago #4

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Posts: 10712
> which appears to be down to how PHP7 handles a FALSE string

Which version of webtrees?

The issue that you are refering to was fixed at the end of last year.

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
The administrator has disabled public write access.
Powered by Kunena Forum