News for hackers. Stuff that matters.
Re:PHP 5 and 7.0 end of life by JeanMarcS on Friday July 19, 2019 @05:15AM (#20477184)
I’ve just finish (yesterday night) to move old websites I host from a PHP 5.2 VM to 5.6

Some of them are more than 10 years old !

And as they represents a good share of my profits, I can’t dump them.

I think I saw a Joomla 1.5.

Those clients don’t want to pay someone to upgrade or redo their site.

There are several intranets that will not support PHP 7 because they use the old mysql_ functions...

So even I loose a lot of my semi-passive incomes, or I continue to tell them on a regular base that they should upgrade.

(For the anecdote, there were around 40 websites before I alerted my clients in April. 5 of them have migrate to last versions of Wordpress or joomla. 35 more to go...)

Re:PHP 5 and 7.0 end of life by philo23 on Friday July 19, 2019 @08:16AM (#20477947)
It's not a great solution, but there are drop in libraries that shim the old mysql_* functions to their mysqli_* equivalents.

https://github.com/dshafik/php7-mysql-shim

It won't be 100% perfect and it's definitely not something I'd want to use long term, but it can help with the initial migration to PHP 7.

Re:PHP 5 and 7.0 end of life by pbowyer on Friday July 19, 2019 @08:32AM (#20478050)
Came here to say the same. I've used them long-term on legacy codebases and they work great for allowing new development to move onto modern PHP.

While I'm using https://github.com/dshafik/php7-mysql-shim, another to look at is https://github.com/mattbit/mysql-compat

Re:PHP 5 and 7.0 end of life by JeanMarcS on Friday July 19, 2019 @12:02PM (#20479727)
Thanks for the suggestions, but my problem remains : who's gonna pay me to do this :-)

It's mainly what prevents me to migrate them by myself. It's a lot of work and no one wants to pay for it.

So it remains on a VM and if it brokes, they were alerted it could happen.

Re:PHP 5 and 7.0 end of life by jcoby on Friday July 19, 2019 @11:37AM (#20479502)
In addition to the shim and compat libs recommended, I've had decent luck with the converter tool (https://github.com/philip/MySQLConverterTool). It goes a bit out of its way to be compatible so one function call can get expanded into a global var + function call.

phpcs + PHPCompatibility ruleset is pretty good about finding issues as well.