software not working after change of php version - php

I have a commercial membership site php program on the server, but after the server upgrade it no longer works. The provider has ceased to operate so there is no support. I am using php 7.0.15, but the server wants me to upgrade to a more recent version, 7.4. This breaks the program /all I get is a blank screen)
My level of PHP does not allow me to debug such a complicated program. My question is:
is there any way of instructing php to only use the older version? I imagine that this would have to be done in the php.ini file on the server?
I would like to upgrade to php 7.4 on the server, but have this software run in php 7.0.
Is this possible?

The simple answer is No - PHP does not offer any options to emulate the behaviour of previous versions.
Partly because features are sometimes removed because they prevented changes in the engine, or would need a lot of work to operate with them; partly just because there is only a limited amount of resources available to work on the core of PHP, and maintaining multiple versions of each feature to enable such compatibility would take effort away from improving the current version.
Your short-term option is to find a way to run an actual copy of PHP 7.0 on the server, or a different server that will allow you to run it. You may need to pay someone who provides unofficial long-term support for old versions, since the last official security patch for that version was over 3 years ago. Even PHP 7.4 will only receive official security patches until the end of this year.
In the long term, your only options are to hire someone to update the application to run on a modern version of PHP, or to migrate to a different application which still has a vendor supporting it.

Related

Migrating website to higher version of PHP

I have a website hosted on a VPS server using PHP version 5.6.40. I would like to upgrade PHP version to 7.0.33. Is there a way to run some sort of audit to determine if anything would break as a result of migration?
The best way to determine this is to have a full suite of tests for the application in question. You can then run it on the new version.
Failing that, I have used PHP Compatibility before, which is a series of sniffs for PHP Codesniffer, and will at least tell you if the syntax is incompatible with the specified version of PHP. It won't guarantee it will work as expected with that version, but will catch syntax problems, which you can then resolve manually.
It still doesn't offer a cast iron guarantee that it'll catch everything, but if the application is small then coupling it with manual testing may be sufficient.

how would migrating from Php 5.3 to 5.6 affect other websites on my server

i am thinking about migrating from php 5.3 to php 5.6 on my company's server, but i'm concerned about how it may affect other websites on the server, especially joomla and wordpress app's, which were hosted some few years back, like 2011. I was trying to host a new website that uses 'get_result()' but i was having some errors when hosting it, even though mysqlnd driver was present, i could only fetch my results using'bind_result()'. so i debugged it, and found out that it's because of a certain driver nd_mysqli which is present in php 5.6. So that's why i decided to upgrade. Are there any issues that could come after this upgrade? Or is there another way of getting the nd_mysqli driver? though honestly i'd prefer to upgrade, this is 2017, it's about time for that.
A fair amount has changed between 5.3 and 5.6, so it is hard to say exactly what issues you may face.
If you are running recent versions of joomla and wordpress the chances are they are compatible as the relevant developers will already have fixed any issues, but if they are as old as php 5.3 then you may run into issues.
Whatever you do, you should create a test server to be sure.
The following pages show the changes that have been made:
http://php.net/manual/en/migration54.php
http://php.net/manual/en/migration55.php
http://php.net/manual/en/migration56.php
You really should upgrade though php 5.3 no longer receives security patches and you are likely vulnerable to something.
It depends on the versions of Joomla and WordPress.
For example, it might be possible to get Joomla 1.5 and older versions of WordPress running on PHP 5.6, but you will need to suppress strict errors as per https://stackoverflow.com/a/9984309/1983389 or similar. It will also depend on what extensions / add-ons are being used.
As #Theo says, it is probably best to do this change in a test environment first so that any issues can be identified and resolved before proceeding with the change on the production server.
An alternative and better long term strategy might be to upgrade the Joomla, WordPress and any other applications on the server before upgrading PHP.

Why do we need to upgrade php version and on live server?

I have a simple question why do we need to upgrade PHP version on a live server? Is there any good reason to do so? I'm confused; we're using PHP 5.3 and our CEO doesn't want to update to PHP 5.5 which is recommended in Laravel 5. Can somebody give me reason why we should or we shouldn't do it?
Further to some of the comments on your question:
Do we need to upgrade PHP
The answer to this part of the question is "No". In some cases it might not be possible to upgrade as newer version can cause applications to break if they rely on older features.
Do we need to upgrade PHP for Laravel 5
The answer to this part is "Yes". You will have to upgrade for Laravel 5 as it relies on newer features of PHP that only exist from PHP 5.4 (Laravel 5) and 5.5.9 (Laravel 5.1).
Should we upgrade PHP
You didn't ask this question, but I put it in here because Yes, you should. Versions of PHP have a lifetime. They are supported in full for bugs for a while, and then they are supported for security flaws for slightly longer. However, after a while, versions of PHP will no longer receive any support. Security holes might be found in older version that will never be patched. You should keep your version of PHP up to date in order to remain safe from PHP vulnerabilities that may have been discovered.
As always, the PHP website contains all the information about the currently supported versions of PHP: http://php.net/supported-versions.php

Server upgrading from PHP 5.2 to 5.3 and Wordpress

My hosting server is upgrading from PHP version 5.2.x to 5.3.x and I have some WordPress and ExpressionEngine installs. I am wondering if anyone knows if this upgrade will effect my site in any way.
I know that the minimum requirements for EE is 5.1.6 and for WordPress it's 5.2.4. So, it seems like they should be ok, but I have never had this happen and just want to be aware of what to look out for.
Thanks in advance.
The upgrade is not before time -- php5.2 has been officially out of support for nearly two years already. (Some would even say that a service provider that is still on 5.2 is being actively negligent of their security)
Wordpress is a popular package, used on a lot of sites. Many of them will have been running 5.3 for years. Even if Wordpress didn't work on 5.3 once upon a time, it would have been forced to update to support it a long time ago.
I remember three years ago Drupal was taking a lot of flak because Drupal 6 wasn't fully compatible with 5.3 and they hadn't finished Drupal 7 yet. That was three years ago.
In short, as long as you're on a recent version of Wordpress (or indeed any other CMS), and you're using plugins that are properly supported and up to date, there's no reason at all to worry.
Conversely, if you're on a version that is old enough not to support php 5.3, then you need to upgrade urgently, because the stuff that was taken out of PHP between 5.2 and 5.3 was all done for security considerations; they removed and deprecated old PHP features that were fundamentally insecure. Therefore, it follows that if your software doesn't work with in 5.3, it means it's likely using those insecure features.
Final thought: http://wordpress.org/about/stats/
I note that the WP stats page shows that a third of WP installations are on 5.3. That should be sufficient proof that it works.
(I'm a little worried about the two thirds who are still on 5.2, though, given what I said in the first paragraph)
In my experience, when doing upgrades like that, a grid service provider will manage that transition, and if you have any issues with your sites not working, you can get help from them.
However, I think you're not likely to see any issues.
What version are your EE sites on? If you're on the 1.x branch, then you'll want to upgrade to at least 1.7.0.

Ubuntu server 11.10 and PHP 5.2 for use with Drupal 6

I'm trying to figure something out:
I am using Ubuntu server 11.10 virtualized on Win7 (I don't think that matters but more info is better than less) to work on a Drupal 6 website I inherited and need to make significant changes to.
I want to set up a development copy of this Drupal website on my Ubuntu server so I can work without worrying about torching the production website.
I successfully got the production files downloaded and onto my machine, I got the production MySQL database exported and imported into the dev MySQL server, and I set up a symbolic link from the directory /home/myname/thewebsite.com to /var/www/thewebsite.com so I can easily access it.
When I got the website they didn't know the admin password so I dug around online and reset it in the dev db using phpmyadmin and finally log in.
When logging in and poking around the site there are lots of errors, which when googled lead me to believe that PHP 5.3 is causing them and that there are some modules in use that only work with PHP 5.2
After looking around a lot online and on stackoverflow there seems to be no easy way to install PHP 5.2 on Ubuntu Server 11.10. With no packages for 5.2 available through apt-get or aptitude what should/can I do?
1) Install 5.2 from source - how do I get it to interface with MySQL and Apache2? Also, I've never installed anything significant from source. Is there a walkthrough?
2) Replace the repositories with old ones? Will this work on 11.10? The newest instructions I found were for 10.04
3) Use already built PHP 5.2 packages for Ubuntu? Couldn't find these
4) Pay someone who knows more to do it for me? (Just kidding, this isn't really an option...)
Cheers and thanks for your help!
PHP dropped support for 5.2 in August 2011; operating system providers such as Ubuntu will not supply a version that is out of support, so you absolutely won't get an official copy of PHP 5.2 on the current version of Ubuntu (or any other OS).
If you're running an older version of Ubuntu (eg 10.04), you might be able to do it; it would still be a downgrade, because PHP 5.3 has been the default version for quite a long time now.
If you're on a newer version of Ubuntu, ie 11.10 as you state, it is going to be a problem for you.
The Drupal developers dropped the ball badly on this one. I guess it was because Drupal 7 tool so long to finish; they were expecting D7 to be out much sooner, and so they never bothered fixing up D6 to work with PHP5.3. As it turned out, this was a big mistake, because in fact D7 still wasn't officially released when PHP dropped support for 5.2.
But even so, they should have fixed it, because they're still officially supporting Drupal 6, so they need it to work with the current version of PHP. This is definitely Drupal's problem, not PHP's, Ubuntu's or yours.
But you still need to deal with it.
I found this question over on AskUbuntu.com, which gives an answer applicable to 11.04. It isn't quite 11.10 you were asking for, but it it a lot more recent than the best you'd found, so it might be helpful.
Alternatively, you could research exactly what it is about Drupal6 and your specific modules that doesn't work in PHP5.3. The language differences between 5.2 and 5.3 that can break things are not big, so I would expect any code changes required to be fairly small. You might find you can fix the code yourself. And maybe even submit the changes to the community -- Drupal is open source, after all.
Another tack you could take is to consider whether this saga represents an opportunity for you to move the site to Drupal 7?
This may or may not be feasible, depending on the modules you're using, etc, but if it is possible, it will solve the problem, because D7 is of course fully compatible with PHP5.3.
And just to cheer you up, I'll close by mentioning that PHP are on the verge of releasing PHP 5.4. Hopefully the Drupal devs will be more on the ball this time.

Categories