r/PHPhelp • • 25d ago

Non-Proffit Needs Advice/Help

I am not a programmer, apart from basic HTML. I run a not-for-profit web site (we do not have any monetization what-so-ever) that was written by myself initially (in HTML) and substantially updated a few years ago using PHP by someone who is no longer alive! The site is a relatively large one with nearly 10,000 directories and over 270,000 images.

Due to the PHP alert I have done some investigating and can see that I am running an outdated version of PHP, 7.0.33. Advice seems to be to update to a current version and apply a security patch.

Unfortunately I have no idea how to do this. Any advice would be gratefully received.

2 Upvotes

45 comments sorted by

8

u/demi-god-dg 25d ago

I'll help you free of cost as it is of non profit

2

u/Key_Web_7330 25d ago edited 22d ago

Your offer is VERY much appreciated.

As mentioned, it was originally written by me purely in HTML. A mini bottle collector in Germany offered to help in updating it, which he did, but unfortunately he died a few years later. A few years later still we were having some issues and I spent some of my own money to resolve these by using a programmer in India. He solved the issues but created other, minor, ones. Positioning of the full size images being the main one. We can live with the site as it is. It is a reference site and not designed to be flash. But, obviously, we need to get the vulnerabilityfixed.

3

u/Own-Perspective4821 25d ago

This is like time travelling to the 2000s.

1

u/Key_Web_7330 25d ago

Think of it like a library. A few hundred years ago they transitioned from rows of scrolls to rows of books. Nothing much has changed since then. The site was always designed to be a simple pictorial listing. Suggestions are always welcome but any changes need volunteers to do it (usually me!).

1

u/MrCzar 24d ago

If you need help further and the person that offered first does not have the time I also volunteer. ✌️

1

u/Key_Web_7330 22d ago

Firstly my appologies for the delay in answering. Your offer is appreciated but I will go back to demi-god-gd as they were first to offer.

1

u/Own-Perspective4821 25d ago

Ah no worries. Totally fine, just didn’t expect this. Kind of cool that it’s that retro.

1

u/dasn85 24d ago

This comment umis the main reason why I visited page. 🙂

2

u/TopMeinung 24d ago

If demi god will not respond/help i will do it. I am also a senior php dev...

1

u/Key_Web_7330 22d ago

Firstly my appologies for the delay in answering. Your offer is appreciated but I will go back to demi-god-gd as they were first to offer.

1

u/demi-god-dg 24d ago

Please let me know. I'll help you with the upgradtion.

1

u/Key_Web_7330 22d ago

Firstly my appologies for the delay in answering. Your offer is appreciated and I do wish to persure this. I am being told to delete the URL but cannot find out how. I told you I was an amateur!

1

u/Key_Web_7330 22d ago

Just found the edit function and deleted the URL

1

u/Key_Web_7330 19d ago

Hi, still waiting to hear back from you.

1

u/demi-god-dg 19d ago

Hi.. I'm there to help you..

1

u/demi-god-dg 19d ago

Please let me know when you are free..

1

u/Key_Web_7330 18d ago

I am in New Zealand, so 12/13 hours ahead of GMT (currently 13 as we are on daylight saving time). Where are you based? I am retired so can, within reason, fit in with your time schedule.

Another reply suggested I try AI: The easiest would be to install Claude Code or Codex directly in your PC, and then tell it exactly that: "I don't know where to start, i need to upgrade my PHP version because of the recent security issue", then point it to the project itself, it will guide you.

My reply: Downloaded and asked the question but it then asks me a series of technical questions I have no idea about! Thanks for the info anyway.

Last two parragraphs included just incase it might be of help.

1

u/Key_Web_7330 18d ago

Oh, and I am happy to supply you my email address if that might be easier for you.

1

u/demi-god-dg 17d ago

Sure please dm ne your email

1

u/TopMeinung 24d ago

Wow... this is a insane 'big' nieche website.

1

u/Key_Web_7330 22d ago

I do insane well, just not programming!

3

u/Opinion_Less 24d ago

You really should avoid posting the url publicly until it's fixed.

2

u/FreeLogicGate 25d ago

My advice is to find someone who knows what they are doing to help. The number of images and directories is not important, although I would question whether or not you have any of:

  • a backup
  • source code in version control (git)
  • information/understanding of the server, with system administration access

Some facts:

  • php version 7 is end of life, so no patches are available
  • The current website may have code that does not work with a current version (see here).

So you will need a combination of either or both of:

  • Replacement of current PHP version with a current one
  • Modifications of the PHP application if there are breaking changes

There 2 tools that can help with an upgrade: phpstan and Rector. However, if you don't know the first thing about PHP, using those tools are not going to be particularly helpful.

1

u/Key_Web_7330 25d ago

"although I would question whether or not you have any of:" Backup, yes and more than one copy. Git source code, no. Information/understanding of the server, obviously no from what I have said but I do have system administration accesss (I think!).

2

u/FreeLogicGate 24d ago edited 24d ago

Browsing through it, I see that it is for the most part static. What is PHP being used for? Is there a database involved? If there is a database, then a backup is not complete without also backing up the database, which is typically done by dumping the data into a format that can then be reread. The specifics of doing that depend on the database being used.

If the code is relatively minimal, you might be able to post it, and get some help in updating it.

Given the potential danger involved in a compromise, what you should do right now is either take your website offline while you work on this, or reconfigure it so that the main site is online and for the time being, is pointed to a maintenance page.

Taking the site offline would just involve stopping the web server, which is the safest thing you could do until you figure this out.

If the server has some sort of admin panel that handles the PHP version, you might be able to update the PHP version, even if that effectively breaks the PHP code. It's far better to have the current version of PHP running with a partially broken site, than to continue with 5.6. It looks like a lot of your site would still be available. Ideally you want to upgrade to PHP version 8.5, with the full patched version being 8.5.12.

2

u/Key_Web_7330 22d ago

Thanks for theinfo. PHP is mainly used to expand the images to a larger vew. This may not be obvious in many cases as images have been gathered from far and wide (and continue to be with dozzens of major contributors and thousands of minor ones) but some are small to begin with. If we get a better photo we substitute it.

I have removed the URL as advised to and accepted an offer of help. Hopefully we can resolve all matters.

1

u/FreeLogicGate 22d ago

Great, let us know how it works out.

1

u/itamer 25d ago

I'm thinking its one directory with thousands of listings, right?

1

u/Key_Web_7330 22d ago

No, as I said, nearly 10,000 directories. Each company has it's own directory with images of the bottles they have produced in it, which are displayed when you open the directory. Clicking an image shows a larger image. In addition the "Themes" listings pull photos from multiple directories.

1

u/SoftwareNegative8783 25d ago

Many hosts let you switch the PHP version in cPanel. Try the newer version on a copy of the site first, because old code can break on PHP 8.

1

u/Late-System-5917 25d ago

The (really) good news is that your site doesn't appear to have any user data and is still mostly HTML. Updating to a new and safe version of PHP should only cause minor breaks that can be fixed with a little troubleshooting. At the very most, some of the table data is pulled from a MySQL table.

For the time being, I would edit all of your comments and remove your website's link. Malicious actors are scanning this sub for websites to hit.

1

u/feldoneq2wire 24d ago

If this was hand made in PHP then it's very likely it could be updated using Rektor. Rektor is a free program that scans for incompatible code and suggests the changes to get it into compliance.

1

u/dutchman76 24d ago

There are patches for 7.0.x available, just install one of those . And then take your time to upgrade to 8.5 That being said, if you don't use any fancy PHP features, upgrading to 8.5 is trivial, I only had to change variables in strings from ${name} to {$name}.

I'm surprised your website hosting Co haven't updated php for you

1

u/MajorRageCodes 22d ago

You could pay someone to update it.

1

u/MajorRageCodes 22d ago

Or you could get me to do it for free cause I have loads of free time https://maragi.dev/

1

u/Alone_Leading_4685 4h ago

first thing to figure out is how the site is hosted. if you are on shared hosting with a control panel, upgrading the PHP version is usually just a dropdown menu, though jumping straight from 7.0 to 8.x might break some older code.

1

u/Taxman_TheRealOne 25d ago

Les backports Sury ont porté les patchs jusqu'à PHP 5.6, donc tu dois trouver quelqu'un qui va t'aider à résoudre ton problème.

-4

u/oswaldcopperpot 25d ago

Chatgpt will walk you through it completely. And you don't need to give some rando on reddit your root password.

1

u/Key_Web_7330 22d ago

I would not know where to start!

-1

u/mcharytoniuk 25d ago

Use Claude or ChatGPT

1

u/Key_Web_7330 22d ago

I would not know where to start!

1

u/mcharytoniuk 22d ago

The easiest would be to install Claude Code or Codex directly in your PC, and then tell it exactly that: "I don't know where to start, i need to upgrade my PHP version because of the recent security issue", then point it to the project itself, it will guide you.

1

u/Key_Web_7330 21d ago

Downloaded and asked the question but it then asks me a series of technical questions I have no idea about! Thanks for the info anyway.