PHP 5.2.x and 5.3.x - php

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.

Related

CodeIgniter compatibility with PHP version?

I am using CodeIgniter 2.2.6 with PHP 5.5 and it works fine. Now I want to upgrade PHP to version 5.6.6 my question is, is CodeIgniter compatible with PHP 5.6.6?
I can't upgrade CodeIgniter to a new version because I have many models based on Version 2.2.6.
Codeigniter 2.2x IS COMPATIBLE with PHP7.1+.
You only need to remember:
Models/classes and so on are case-sensitive and have to start from capital letter
The same with names of files in application folder
There are problems with mysql (very old, not used now driver) so you have to use mysqli driver (but it is already implemented in CI2, check if you're not using it already)
if you have session table sometimes you'll have to truncate this table, clear cache and populate it again.
Check compatibility of software in third_party folder if you have problems - CI is not responsible for that issues.
In my case everything is working smoothly with the newest version of bootstrap & jQuery installed. However, I'm not using hooks, advanced functions and so on.
NOTE, that in most cases you can force server to use older php version using .htaccess and AddHandler command:
AddHandler application/x-httpd-php56 .php
This is last version of PHP before PHP7.
And last but not least - of course I don't recommend to use this very old version of CI, however in my opinions - in my cases - there is no sense to migrate from CI2x to CI3, in 2018 it is better to wait for CI4 and then migrate.
The Server Requirements page in the user guide says that CodeIngiter 2 requires "PHP version 5.1.6 or newer".
Note that PHP 5.6 will stop receiving active support in less than a month, so you might want to go right to version 7. PHP 5.6 should receive security patches until the end of 2018.
I can't upgrade CodeIgniter to a new version because I have many models based on Version 2.2.6.
Note also that CodeIgniter 2 is no longer supported:
the current version (2.2.6) came out in October, 2015.
CodeIgniter 2 has reached its end-of-life for support and updates, as of October 31, 2015. No further updates are planned.
We encourage you to upgrade to CodeIgniter 3.x!
There is an upgrade path from version 2.2 to version 3.1, which I encourage you to explore:
First, read Upgrading from 2.2.x to 3.0.x
Then, read the steps for performing minor upgrades
This probably isn't as hard as you think, and with the security implications I believe it's worthwhile.

Failed installation of zend-escaper with Composer

I'm trying to install zend-escaper but I'm getting this error:
This is strange as my PHP version (from phpinfo()) is 5.5.19, the message claims it is 5.3.5(!) which should satisfy the requirement anyway.
My ZF version is 1.12.13
I'm using PHP Storm
Can anyone help please?
Thanks
Tomasz
The PHP version on the command line can be a different executable than the PHP running inside the web server. It also can use a different pho.ini configuration file.
So if Composer states the PHP it is using is 5.3.5, this is correct because Composer is directly asking the PHP it is running on for its version. The problem is when this PHP version on the command line is way older then the PHP version in the web server.
Try to update your command line PHP.
Some more things to say: the version 5.3.5 is lower than the required 5.3.23, because the last number in the version is 5 compared with 23, and 5 is less than 23. So the version you are using is below the minimum requirement for zend escaper - at least in the version 2.5.1 you try to use. Such an old PHP was last supported in the 2.2 framework versions, so you might as well try to depend on ~2.2. However this will simply be a workaround for the old cli version.
One other note: You are in the process of installing a zend framework 2 component - don't expect your installed zend framework 1 to support any fancy stuff on its own. It is possible to mix classes with namespaces and without, and even use zf2 things together with zf1, but zf1 won't offer any automatic functionality to use these.

PHP version upgrade 5.3.25 to 5.6

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

Is PHP 5.4 compatible with PHP 4.4.2?

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

PHP compatibility issues

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.

Categories