- Posts: 127
Question PDO Duplicate Error On Attempting Upgrade
- slateronline
- Topic Author
- Offline
- Junior Member
On attempting a regular upgrade tonight I was forced to roll back due to getting this (cleared browser cache):
"#0 /app/Statement.php:86 PDOException("SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1494107185-1494107185--unknown' for key 'wt_site_access_rule_ix1'") #1 /includes/session.php:357 execute([array]) #2 /admin.php:28 require('/home/#####/public_html/fam…')"
Any help appreciated. Tnx.
Neil
Neil
latest v2.1.16 | php v8.2 | mysql v7.4.28
Site: familytree.slateronline.com
Please Log in or Create an account to join the conversation.
- fisharebest
- Offline
- Administrator
PHP appears to be giving inconsistent views of the $_SERVER information. It seems to give different versions of the same information depending on whether you query it via the superglobal or via filter_input(). Also, it might be putting it in the $_ENV variable instead.
Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net
Please Log in or Create an account to join the conversation.
- slateronline
- Topic Author
- Offline
- Junior Member
- Posts: 127
Neil
latest v2.1.16 | php v8.2 | mysql v7.4.28
Site: familytree.slateronline.com
Please Log in or Create an account to join the conversation.
- fisharebest
- Offline
- Administrator
gives you the same results as
Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net
Please Log in or Create an account to join the conversation.
- resist
- Visitor
Results:
Thank you!
Please Log in or Create an account to join the conversation.
- fisharebest
- Offline
- Administrator
bugs.php.net/bug.php?id=49184
What exact build/version of PHP are you using?
Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net
Please Log in or Create an account to join the conversation.
- resist
- Visitor
Please Log in or Create an account to join the conversation.
- fisharebest
- Offline
- Administrator
I guess we will need to modify webtrees to avoid this PHP function...
Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net
Please Log in or Create an account to join the conversation.
- resist
- Visitor
thanks for your answers!
Please Log in or Create an account to join the conversation.
- meliza
- Offline
- Senior Member
- Posts: 342
includes/session.php, includes/php_53_compatibility.php and admin_site_access.php
webtrees 1.8.0-dev at amitys.com/webtrees - php 5.6.29 - mysql 5.0.11-dev
Please Log in or Create an account to join the conversation.
- fisharebest
- Offline
- Administrator
resist wrote: I have the same problem here. Do you have any suggestion, what can I do to resolve this problem?
Code:<?php var_dump(filter_input(INPUT_SERVER, 'HTTP_USER_AGENT')); echo '<br>- x -<br>'; echo $_SERVER['HTTP_USER_AGENT'];
Results:
Code:NULL - x - Mozilla/5.0 (Windows NT 6.1; WOW64; rv:35.0) Gecko/20100101 Firefox/35.0
Thank you!
What happens if you do this in the reverse order. e.g. $_SERVER first and filter_input() second.
Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net
Please Log in or Create an account to join the conversation.
- resist
- Visitor
I get
Please Log in or Create an account to join the conversation.
- fisharebest
- Offline
- Administrator
Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net
Please Log in or Create an account to join the conversation.
- meliza
- Offline
- Senior Member
- Posts: 342
echo $_SERVER;
and
echo filter_input(INPUT_ENV, 'HTTP_USER_AGENT');
show the same result
and
echo Filter::server('HTTP_USER_AGENT');
and
echo filter_input(INPUT_SERVER, 'HTTP_USER_AGENT');
show NULL
Meliza
webtrees 1.8.0-dev at amitys.com/webtrees - php 5.6.29 - mysql 5.0.11-dev
Please Log in or Create an account to join the conversation.
- meliza
- Offline
- Senior Member
- Posts: 342
echo $_SERVER;
webtrees 1.8.0-dev at amitys.com/webtrees - php 5.6.29 - mysql 5.0.11-dev
Please Log in or Create an account to join the conversation.
- meliza
- Offline
- Senior Member
- Posts: 342
something removes the rest
webtrees 1.8.0-dev at amitys.com/webtrees - php 5.6.29 - mysql 5.0.11-dev
Please Log in or Create an account to join the conversation.
- fisharebest
- Offline
- Administrator
[ c o d e ]
[ / c o d e ]
Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net
Please Log in or Create an account to join the conversation.
- meliza
- Offline
- Senior Member
- Posts: 342
webtrees 1.8.0-dev at amitys.com/webtrees - php 5.6.29 - mysql 5.0.11-dev
Please Log in or Create an account to join the conversation.