I am using 'MJS_Controller_PathRouter' in any ancient Zend Framework version 0.6 and PHP 5.1.6. When I run this in a newer php version e.g. 5.2.x or 5.3.x, it is throwing this error:
Declaration of
MJS_Controller_Router_PathRoute::__construct()
must be compatible with that of
Zend_Controller_Router_Route_Interface::__construct() in
/opt/ezxwebadmin-versions/ezxwebadmin_2.11.5/Library/MJS/Controller/Router/PathRoute.php
on line 34
I would like to remove this enhanced rewrite router and upgrade our application to use a newer Zend Framework version. Our web application doesn't use any of the classes provided by Zend and we are only utilizing the MVC architecture and rewrite functionality from Zend framework.
Now could any one advise which Zend Framework version would be best for us to upgrade to?
The error you are getting is actually a PHP strict coding standards error and should be fairly easy to fix. Just open up Zend_Controller_Router_Route_Interface and MJS_Controller_Router_PathRoute and compare the parameters for the __construct method. They need to be the same, so change your class to match the parameters in the interface.
Zend Framework requires PHP 5.2.4. ZF2 will require PHP 5.3+. PHP 5.1.6 is almost 5 years old so you really should be upgrading (or planning to). If you are using something like CentOS with really ancient PHP packages, you might want to consider switching to Zend Server community edition (which is free). This can be installed with Yum and will give you more recent versions of PHP.
You should take a close look at the Zend Framework Migration Notes starting at 0.8
Then look through the Zend Framework Download Archives and upgrade your framework version by version (follow the versions listed in the migration notes) to either get to a version that works with the PHP you have or (ideally) the latest version: 1.11.x
Related
I'm working in a project with Symfony Framework, but i have problems with php 7.0. Can I downgrade the php version or I need rewrite the entire application?
Symfony 3 requires at least PHP 5.5.9, so generally speaking, you can downgrade if you want. Of course you might have other limitations, like additional bundles and libraries you have installed and you might have used PHP 7 features inside your own code.
If you want to downgrade you can run:
composer why-not php:5.6
This will tell you which libraries you installed will not work with PHP 5.6. You might be able to downgrade them, but obviously this is not guaranteed and might require changes to how you use those bundles and libraries. For this you will have to check their upgrade guides and "undo" those changes.
For checking your own code you can use tools like etsy's phan to check for compatibility with a specific target version of php: https://github.com/phan/phan#usage
Is it possible to upgrade Zend Version 1.10 to the latest version? Also, I assume I can't upgrade the PHP version (5.2 currently) to the latest as I'm running an Older Zend Version.
Can someone give me some insight here?
You should be able to upgrade to the last released version of ZF 1.x. (1.12.20) with minimal changes. I would expect this ZF version to work on PHP 7.
There are some docs for migrating a ZF1 app to ZF2 (not ZF3), but this is no small task (basically a rewrite of your application).
Both your ZF version and PHP version are past end of life (i.e. no longer receiving updates), so it's good that you are planning an upgrade.
Is Zend Framework 2 work with PHP version 5.3.2?. During the skeleton application installation i got following message.Is this just a warning or it will cause any problem in future?
D:\web\Apache24\htdocs\zendsample>composer create-project -n -sdev zendframework
/skeleton-application D:\web\Apache24\htdocs\zendsample
Your version of PHP, 5.3.22, is affected by CVE-2013-6420 and cannot safely perf
orm certificate validation, we strongly suggest you upgrade.
Installing zendframework/skeleton-application (2.4.11)
Make thinks short :
With PHP 5.3 you'll not able to use Traits and new features php 5.4 wich is used in most of vendor plugin and the framework itself.
Usually it's strongly recommanded to upgrade your PHP version.
From this link PHP version maintained PHP 5.3 is no longer maintained since 2014. It's antique. You'll be face to security issues and no evolution of your code will be possible.
To answer your question :
You'll not able to use traits
You'll faceing security issues
You'll not able to improve your code withe best practises (wich evolves permanently)
your views can't use short version for echoing stuff <?='toto'?>
All new features linked above are not supported with your version if it's used in the framework, you'll can't run the framework itself.
I recommend upgrade your version at least at 5.6 or 7 for a good longevity support
EDIT : 5.5 to 5.6 because 5.5 no longer supported.
After getting this message i just upgraded my php to 5.5.
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.
I'm trying to find a copy of the Zend debugger for PHP 5.4.
I've followed the various tutorials on the web telling me to download the Studio Web Debugger from the zend website, but unfortunately it only contains the binaries for PHP 5.3 (and below). I can't seem to find any mention anywhere of the Zend Debugger for PHP 5.4 ... it seems like they no longer make it and instead want you to use their full Server product instead.
Amazingly, Zend, "The PHP Company", will sell you Zend Studio, but they will not package a 5.4 version of the Studio Debugger in the related download. I would think they could get an updated version out since 5.4 has been released for over a year...
In any event, a work around has been making the rounds on the Internets.
Here is a full set of instructions for a Debian based system.
It was based largely on this Zend Forum post...
http://forums.zend.com/viewtopic.php?t=47568&f=59#p148893
The gist is to lift a 5.4 debugger file from an old Zend Server download an use it instead.
Many thanks to the original posters.
I had the same problem - however recent versions of the debuggers for php 5.3.x and php 5.4.x are included in the free version of Zend Server, so you can install that, make a copy of the .dll or .so that you need, and then uninstall it.
I did this to get at a version of ZendDebugger.dll that would work with php 5.3 and Zend Studio 10, but there is a 5.4 version of Zend Server aswell.