I have updated the php version on our database so we can work some wordpress websites. since updating from PHP Version 5.2.1 to 5.2.17 we have had some issues with other services on our db.
So I'm woundering is PHP 5.2.17 backwards compatible with php 5.2.1?
Yes, it should be compatible. 5.2.1 and 5.2.17 imply the first and seventeenth patch release (still the 5.2.x release family), respectively. Check the changelog: http://us.php.net/ChangeLog-5.php
5.2.1-5.2.17 are mostly bug fixes and minor feature enhancements.
There are probably some subtle changes, so you will want to look through the summaries on that page of each release. Or at the very least search on the changelog page for the functions you are having problems with to see if there were any changes. Other than that, no, there shouldn't be any groundbreaking differences.
Related
We have a requirement for upgrading the PHP version (5.3.25) to current stable version which is 5.6.17. So, for this we need to find which approach would be best.
Step by step approach, in which we can upgrade from 5.3.X to 5.4.X, 5.4.X to 5.5.X and so on.
Direct upgrade, in this we will directly upgrade from 5.3.X to 5.6.X.
Apart from the upgrade, what all things we should keep in mind while doing this.
It would be good, if any of you have any documents which we can refer to.
PHP maintainers upload list of incompatible changes of every release. Here are the documents you may want to read:
5.4 incompatible changes
5.5 incompatible changes
5.6 incompatible changes
If you have regression tests, you're the lucky man; if you don't, i strongly recommend test every change in virtual environment before real environment update on main server. If you're brave enough, you can try to setup vagrant - this will allow developers to easily share their environment and to reproduce server state as it should be after upgrade to 5.6.
I also wouldn't recommend partial upgrades, i think it's better to target for 5.6 at the first (and only) migration step.
On my experience, we upgraded our PHP version from 5.3.28 to 5.6.6 directly because of server upgrades, and one more reason is you can easily check all your modules faster if there's an error rather than checking it on every version.
What you should keep in mind:
deprecated functions
if you're using PHP frameworks (CodeIgniter, Laravel, etc.), consider upgrading them too
current code implementations
I read this article recently on Ars: http://arstechnica.com/security/2014/03/php-bug-allowing-site-hijacking-still-menaces-internet-22-months-on/
I have some very old PHP servers still running some legacy code. They use PHP version 5.2.17
The article above states that PHP versions prior to 5.3.12 and 5.4.2 are vulnerable.
The fact that they mention 5.3.x and 5.4.x, it makes me think that 5.2.x is NOT vulnerable - is this correct?
Thank you to anyone who can confirm and provide a reputable source for this.
PHP versions prior to 5.3.12 and 5.4.2 are vulnerable.
5.2.17 is very much prior to both of those. If you look on http://www.php.net/ChangeLog-5.php#5.4.3, bug #61910 was fixed only in the 5.3 and 5.4 branch.
Having said that, the wording may be ambiguous. PHP 5.2 may be left out because it was not supported anymore. Or it may have been left out because the vulnerability only existed in 5.3+. I can't find definitive proof one way or the other.
I was recently asked about a legacy application that is running on PHP 4.4.2 on IIS 6.0. We were informed that this version of PHP is out of date and contains security vulnerabilities
I personally, have zero experience with PHP.
It has been suggested that we upgrade PHP to a later version. According to Wikipedia, the latest stable version is 5.4. Is version 5.4 backward compatible with 4.4.2?
I assume that there is an installer for PHP 5.4 that we could run that would install the new version of PHP. Would that work safely and the legacy application would still run fine?
Are there any breaking changes in newer versions of PHP that might make upgrading the legacy PHP application risky?
Look at this, check for any deprecated code (especially preg VS ereg ) -
http://www.php.net/manual/en/migration5.incompatible.php
Look for the general differences -
http://www.php.net/manual/en/faq.general.php#faq.general.differences-45
Check about the migration -
http://www.php.net/manual/en/faq.migration5.php
EDIT -
One more general link, may be helpful at times -
Check Change Logs
I'm starting to learn PHP. I would like to use PHP 5.3 because it's the newest version so far. I'm working on a project in which I'll use PHP 5.2 scripts that someone gave me.
Are they going to run just fine even though I'm using PHP 5.3?
PHP.net features a guide for upgrading from PHP 5.2.x to PHP 5.3. This includes a section on backwards compatibility.
From my experience, the transition from 5.2 to 5.3 went pretty smoothly smoothly. The only problems I had with my app was to ensure my DateTime setting were property configured in my php.ini, and filter out some overly-agressive deprecation warnings that started showing up.
No, 5.3 is not backward compatible, and by all means it shouldn't be seen as a minor version upgrade.
There is a page dedicated to incompatible changes: http://www.php.net/manual/en/migration53.incompatible.php
Also consider functions you have designed but have been accepted into 5.3. Since php doesn't support overloading or overwriting of functions, this will give an error.
For the most part, minor version releases aren't going to cause you problems. You should be okay.
Obviously, if you do have any problems, you'll want to make sure you have error_reporting set to see all errors. PHP: error_reporting
Also, check the manual for changes in 5.3 from 5.2: Migrating from PHP 5.2.x to PHP 5.3.x
There are some minor issues. Call time pass by reference are deprecated. There are new reserved words (ie. goto).
php has no backward compatibility in all version. It often removed some functions when it changed version. The problem occurs when you have to upgrade server and need to change php version but some php scripts no longer work with new php version. You also have to correct php script which is a bigger job. But if the script belong to other users rather than yours, you can't upgrade those scripts. This is a real headache situation that I'm fed up with php and switch to perl instead for backward compatibility reason.
What are the differences between PHP 5.2.x and 5.3.x?
Because all extensions are made separately for these.
Thanks a lot.
PHP 5.3 is a newer version with a number of new features (closures, namespaces, etc.). Is is the current stable version for the PHP project. PHP 5.2 is an older version, which is now heading towards the end of its support cycle - now only important security issues are being fixed. If you start a new project, start it with PHP 5.3.
When changes in PHP core are made that change the structure enough that extensions can no longer be compatible - the second digit in the version number is incremented (5.0, 5.1, 5.2, 5.3). The first digit is for very major changes changing the whole language (like between PHP 4 and 5). Between 5.2 and 5.3, you can expect source code compatibility (though some incompatibilities exist) but not binary module compatibility.
You can find an exhaustive list of backwards incompatible changes from 5.2 to 5.3 on PHP.net.
PHP extensions depends on the phpapi version among other things, along with the Zend Module API version and the Zend Extension API version, which as far as I'm aware, changes at each PHP version because of the core changes made to the language. This explains why each PHP version has a new build for each extension.
You can find the answer in PHP official website.
In this page: Migrating from PHP 5.2.x to PHP 5.3.x.