Web based family history software

Question Cannot add any media in webtrees 1.7.17 under PHP 7.4

  • trejder
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
3 years 3 months ago - 3 years 3 months ago #1 by trejder
Since I have both Wordpress and webtrees served by the same hosting, I have recently changed -- as advised by Wordpress -- PHP version that is default for my hosting.

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:
Code:
http://example.com/addmedia.php?action=showmediaform&linktoid=Ixxx&ged=TREENAME

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)?
Last edit: 3 years 3 months ago by trejder.
The topic has been locked.
  • hermann
  • Away
  • Elite Member
  • Elite Member
More
3 years 3 months ago #2 by hermann
Yes, if you like to stay at webtrees 1.7 you have to use PHP 7.3; if you like to use PHP 7.4 then you have to upgrade to webtrees 2.0.

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
The topic has been locked.
  • trejder
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
3 years 3 months ago #3 by trejder
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 topic has been locked.
  • norwegian_sardines
  • Offline
  • Platinum Member
  • Platinum Member
More
3 years 3 months ago - 3 years 3 months ago #4 by norwegian_sardines
Replied by norwegian_sardines on topic Cannot add any media in webtrees 1.7.17 under PHP 7.4
Based on the information on the webtrees home page:

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
Last edit: 3 years 3 months ago by norwegian_sardines.
The topic has been locked.
More
3 years 3 months ago - 3 years 3 months ago #5 by Sir Peter
I suggest to
  • 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
Last edit: 3 years 3 months ago by Sir Peter.
The topic has been locked.
  • trejder
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
3 years 3 months ago #6 by trejder

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.
The topic has been locked.
  • trejder
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
3 years 3 months ago #7 by trejder

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.
The topic has been locked.
More
3 years 3 months ago #8 by Sir Peter
You can test that by creating a folder, a .htaccess file and a phpinfo file as indicated by the websites you referred to.

Peter
The topic has been locked.
  • trejder
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
3 years 3 months ago #9 by trejder

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.
The topic has been locked.
  • fisharebest
  • Away
  • Administrator
  • Administrator
More
3 years 3 months ago #10 by fisharebest

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
The topic has been locked.
  • trejder
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
3 years 3 months ago #11 by trejder

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.
The topic has been locked.
More
3 years 3 months ago #12 by makitso
>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.

Rob
www.skatekey.net ( webtrees 2.1 beta GitHub)
webtrees forum admin
PHP 8.1.21
Hosted at tigertech.net
The topic has been locked.
  • fisharebest
  • Away
  • Administrator
  • Administrator
More
3 years 3 months ago #13 by fisharebest

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
The topic has been locked.
Moderators: makitso
Powered by Kunena Forum
}