- Posts: 242
Question Cannot add any media in webtrees 1.7.17 under PHP 7.4
- trejder
- Topic Author
- Offline
- Junior Member
Change of PHP 7.3 --> 7.4 caused that I have lost the ability of adding any media / photos etc. in webtrees.
Under PHP 7.4 the "Add a media object" link, on any individual, pops up a new window as usual, but this window is completely empty:
All other popups and all other functionality of webtrees seems to be functioning normally.
I have tested this on two different PCs (home and office) and two different browsers (Chrome and Edge). I have also tested this under mobile Chrome and mobile Firefox / Android 10 and under mobile Safari / iOS. Results are everywhere the same.
Popped up window displays nothing and there is absolutely nothing it its source (Ctrl+U shows 0 byte response). Browser's console is as empty as popup page's source.
This is 99.99% caused by PHP 7.3 --> 7.4 change. Reverting main version of PHP in my hosting back to 7.3 brings back "add media" functionality.
I have webtrees 1.7.17.
Is there anything known about it (that 1.7.17 can cause such behavior under PHP 7.4)? Is there anything I can do about this (except migration to 2.x branch)?
- hermann
- Away
- Elite Member
Hermann
Designer of the custom module "Extended Family"
webtrees 2.1.19 (all custom modules installed, PHP 8.2, MariaDB 10.6) @ ahnen.hartenthaler.eu
- trejder
- Topic Author
- Offline
- Junior Member
- Posts: 242
Do you know (or does anybody know) how does this look from a development perspective?
Is this just a tiny bug, that causes empty response in PHP 7.4, that I could fix myself, and that is only not fixed, because general support for 1.7.x is over?
Or is this a half-webtrees recoding from scratch to make this fixed? And migration to 2.x is the only option?
- norwegian_sardines
- Offline
- Platinum Member
- Posts: 2993
webtrees version 2.0.0 was released 7 December 2019. It runs on PHP 7.1 - 7.4. This is the latest version of webtrees, and is actively developed and supported.
webtrees version 1.7.16 was released 7 December 2019. It runs on PHP 5.3 - 7.3. This is a legacy version of webtrees, for servers with an old version of PHP. It will receive security patches, but no other development.
A lot of code changes and enhancements went into v2.0 so the change is probably not easy in 1.7 of webtrees.
Ken
- Sir Peter
- Offline
- Senior Member
- Posts: 483
- either downgrade to php 7.3 because Wordpress 5.5.x and 5.6.x and webtrees 1.7.17 work pretty well with that version
- or check whether you can run different php versions on different sub-domains for Wordpress and webtrees.
Peter
- trejder
- Topic Author
- Offline
- Junior Member
- Posts: 242
norwegian_sardines wrote: A lot of code changes and enhancements went into v2.0 so the change is probably not easy in 1.7 of webtrees.
I know that a lot of coding went into 2.x branch. That's obvious. You have even said somewhere that most parts of webtrees were rewritten from scratch.
I was more like interested in (and only to feed my curiosity) in this single part that I have touched. Were you aware about getting empty result in "Add media" popup for PHP 7.4? Do you have any idea what can be causing it and how big coding challenge would be a possible change? Etc.
Again, just my curiosity, so feel free to answer "don't know". I am pretty sure that upgrade to webtrees 2.x is something that I won't be able to avoid in a close future.
- trejder
- Topic Author
- Offline
- Junior Member
- Posts: 242
Sir Peter wrote: or check whether you can run different php versions on different sub-domains for Wordpress and webtrees.
Thank you for your answer and your suggestion. I went through quite exactly the same thinking:
www.fastcomet.com/kb/how-to-set-custom-p...ersion-per-directory
www.webhostface.com/kb/knowledgebase/php-version/
gist.github.com/erlangp/365399115e75e231454c59a8ea7e4079
www.webfulcreations.com/change-php-version-via-htaccess/
However, my ISP said that this is not possible under their shared hosting (and that I have to buy resellers account instead). Which is quite very surprising for me.
Does anyone of you know, whether enforcing PHP parser version for just a single folder in shared hosting, through proper entries in .htaccess file, is or isn't a default Apache feature? Is this truly possible that my ISP can block this feature and say "no"? Or is this just a matter of their policy that they don't want to get involved.
- Sir Peter
- Offline
- Senior Member
- Posts: 483
Peter
- trejder
- Topic Author
- Offline
- Junior Member
- Posts: 242
Sir Peter wrote: You can test that by creating a folder, a .htaccess file and a phpinfo file as indicated by the websites you referred to.
Sound like a great yet simple pro-tip. Thank you.
- fisharebest
- Away
- Administrator
trejder wrote: Thank you for an ultra fast answer.
Do you know (or does anybody know) how does this look from a development perspective?
Is this just a tiny bug, that causes empty response in PHP 7.4, that I could fix myself, and that is only not fixed, because general support for 1.7.x is over?
Or is this a half-webtrees recoding from scratch to make this fixed? And migration to 2.x is the only option?
the problem is not simply to update the webtrees code. there are lots of third party libraries tbat do not support php 7.4
so a lot of code must be rewritten to use different libraries
Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net
- trejder
- Topic Author
- Offline
- Junior Member
- Posts: 242
fisharebest wrote: the problem is not simply to update the webtrees code. there are lots of third party libraries tbat do not support php 7.4
so a lot of code must be rewritten to use different libraries
Wow, I think you missed my point! :>
I was more like asking, if you have any idea why this particular issue (adding media under PHP 7.4) fails? And if there is any chance to estimate work effort needed to fix this particular bug? To rewrite add_media.php to make it compatible with PHP 7.4.
I am not talking about porting the whole webtrees (with all the libraries) to PHP 7.4 as that would be pointless. Migration to 2.X is by far more reasonable solution.
- makitso
- Offline
- Administrator
I think Greg is pretty busy and doesn't have the time to research your specific issue.
Rob
www.skatekey.net ( webtrees 2.1 beta GitHub)
webtrees forum admin
PHP 8.1.21
Hosted at tigertech.net
- fisharebest
- Away
- Administrator
makitso wrote: >I was more like asking, if you have any idea why this particular issue (adding media under PHP 7.4) fails?
I think Greg is pretty busy and doesn't have the time to research your specific issue.
Due to lockdown rules in the UK, I have been living away from home for the last few months.
I don't have access to my nice development environment - just a laptop.
And this week I am away scuba-diving - with limited internet access.
So, I have not been able to spend as much time on webtrees as usual.
Hopefully, things will return to normal after christmas.
Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net