r/PHPhelp • u/Lumpy-Being8449 • Oct 22 '26
ubuntu 16.04, upgrading for php 5.6.30
I asked run the andrej script, but seems failed. i asked chatgpt, it say that there is no support for ubuntu 16.04. The oldest version that sury.org support is 22.04. any bro can advise how I can patch my php5.6.30? thanks.
1
Upvotes
5
u/Jutboy Oct 22 '26
Thats really old...its going to be a challanging upgrade unless you dealing with the simplest of php code.
1
u/colshrapnel Oct 22 '26
You cannot but assuming such an ass old site doesn't use file uploads anyway, you can simply do a makeshift protection explained in the posts below
1
u/dreddit_reddit Oct 22 '26
Ubuntu pro / ems, chekc to see if that is possible.
1
u/jorgedferreira Oct 23 '26 edited Oct 23 '26
I used this: https://github.com/HOSTED-POWER/php_uploadprogress_guard Install the extension, be safe for those cves and afterwards upgrade the code, migrate/deploy to a new server
1
u/Devnzian Oct 23 '26
You can build yourself from updated source code and then use it. Where vendor or os not support or updated then it's your own responsibility to update yourself. 16.04 is very old os. Either you can update os or download source from php.net and build yourself
1
u/Tomas_Votruba Oct 23 '26
You might need to do some hacking of your Ubuntu version name: https://getrector.com/blog/how-to-install-old-or-new-php-on-non-lts-ubuntu
1
u/janisbiz Oct 24 '26
I am in same boat. Basicaly three options:
I am doing option 2 now.
1
u/redpotatojae Oct 24 '26
That version is very old, and you need to actually upgrade your server to bring it up to date.
Unfortunately, this can't be fixed with a quick script or two. You'll need to upgrade the server and the PHP version, and then update your application to ensure compatibility.
1
u/DeprecatedSoulCoder Oct 22 '26
PHP 5.6.40 Debian package builder for legacy Ubuntu, including Apache mod_php
I built an experimental tool that downloads pinned sources, applies the community php2shell patch, and builds Ubuntu packages, including mod_php and historical PECL extensions.
Native builds and bounded CLI/Apache tests passed on Ubuntu 16.04 and 18.04. Ubuntu 20.04 remains untested. Known extension conflicts and test limitations are documented.
Build scripts and reviewed test evidence are available; no binary packages are distributed. Independent reviews and additional test reports are welcome.
GITHUB: https://github.com/DeprecatedSoulCoder/php5.6-php2shell-deb-builder
1
u/Johto2001 Oct 22 '26 edited Oct 22 '26
Your server OS is 10 years out of date? You need to fix that. If this is an internet facing server, take it down, take a full backup. Store that backup off the server. Upgrade the OS. If it's a virtual machine, clone or create a new one, upgrade/clean install the OS to a supported Ubuntu LTS edition (22.04 LTS), deploy your site to the new OS (best to do it from a recent backup you are reasonably sure is clean if it has been online unpatched for the last 24 hours). If you have a database, you could move the actual data to a supported vendor for the time being (e.g. AWS RDS, or similar) so you can focus on the PHP side.
Then upgrade PHP. Is it really necessary to stick with 5.6? Your client/customer, needs to pay for an upgrade to a supported PHP version. Use Rector. There are people who will do that for you as a service, expect to pay. 8.2 is the oldest supported version.
Ubuntu do have a subscription support option for Ubuntu versions up to 15 years old but I have not used that, thought it might be useful though, but ultimately you still need to migrate soon.
1
u/martinbean Oct 22 '26
Why on earth are you running such old versions of Ubuntu and PHP? 😬