I've so far been unable to find a working answer for this... And, let me say, I'm brand new to Zend/MVC.
I've installed Zend Server CE on CentOS, running Apache. I'm able to use the Zend GUI interface (with the options like "Monitor, Applications, Server Setup, etc.). PHP is running and executing fine.
All is ok, except when I try to instantiate any Zend Custom Classes. For instance when I try to create a Zend_Rest_Controller class, I receive the following message:
Fatal error: Class 'Zend_Rest_Controller' not found in /mnt/hgfs/API/index.php on line 15
This stays the same for any class I try. I read things about altering the php.ini file, or including the Zend library in the index.php page, but nothing has helped so far.
My question is: What steps in addition to installing Zend do I need to do to let me use the Zend classes?
Sorry if this is an ignorant question, but I appreciate the help.
There are two different products of Zend, which I think you are confusing. There is Zend Server CE (which you just installed). And there is the Zend Framework. As far as I know, Zend Server CE is distributing the Zend Framework with it, but it probably distributes version 2. And, looking at the name of the class you are referring to, that is a class from version 1 of the Zend Framework. Since version 2, the Zend Framework uses namespaces, and thus the class Zend_Rest_Controller does no longer exist. If you want to use version 1 Zend Framework, you will have to install that seperately.
Related
The problem is that I can't find the version.php file on the server within the Zend folder. The developer left so all I got is the source code which are also encrypted. I tried to call echo Zend_Version::VERSION; but Zend said "version.php" is not there. So I am out of means.
So I need to know:
What is the Zend Framework number? ( 1.? or 2.?)
As encrypted as the source code now is from what I see on the server, is it possible for someone to keep developing it? (I know PHP but not Zend Framework.)
Appreciated.
I think you can identify ZF major version by looking at directory structure even files are obfuscated.
ZF 1.12 Directory Structure
ZF 1.12 module Structure
ZF 2.0 Directory Structure
For ZF2 < 2.5 you can go to vendor/zendframework/zendframework/library/Zend/Version/Version.php
For Zf2 >= 2.5 you can go to
vendor/zendframework/zend-version/src/Version.php
And then in this class Version.php you have a constant wich tells you what version do you have (complete form with minor)
For Zf1 I have no clue, since I'm not using it.
For ZF1, you can check via /library/Zend/Version.php
We are resurrecting some old code that used the Zend framework. The old code extends several Zend classes, invokes getOptions() and uses some other Zend functions. We tried installing Zend Framework with XAMPP (click here) without the Zend Server. We have loads of errors that prevent the legacy site from rendering properly.
Is Zend Server necessary to use all the methods, etc. of Zend Framework?
Yes, you can run Zend Framework without Zend Server (and I'd guess this is a much more common setup than using both together). The only thing I can think of in ZF that would require Zend Server would be the Zend Server Cache Backend.
It's more likely that your issue is down to a difference in configuration between your old server and new. If you can give examples of some of the errors you're getting we might be able to suggest where to look.
Why do I have to configure an include_path when installing Zend Framework instead of just manually including? I've never done this before and can't really see the point, also I've spent some time trying to figure this out with no luck hence why I ask.
Actually I add Zend framework to the include path to be able to use Zend tool.
If you want to create a project structure and add controllers or models or even scripts using Zend Tool you will have to have Zend framework added to your include path.
Another reason you may want to ship your project without the library itself so that the end user doesn't update the framework version himself and break your code.
Also if you are working on different project at a time you may want to keep only one version of the framework shared between different projects. This is handy when you need to update your version of the framework without going through all projects every time.
You don't have to set your php include_path to include the ZF library you could just copy the whole ZEND directory into your applications Library directory and continue on.
But a lot of us are working on more then one project or don't want to have the library in our application so we add it to the php include_path so php and our application can find it.
Now if you are refering to the windows or linux path, those are required to use the ZF cli components ZF.bat and ZF.sh
When modifying the Include Path you can use Zend Framework without knowing the Full-Path of it. You can simply use require('Zend/Loader/Autoloader.php') and PHP will search in every include path.
For more information have a look at: http://php.net/manual/en/ini.core.php#ini.include-path
I am considering to use Zend Framework in a future project in a Linux Environment. I did the introduction tutorial and quite liked the framework. Yet there's one question i couldn't really find an answer around.
What is the benefit of using Zend Server CE , besides that it wraps up MsSQL and PHP and Apache? As far as i figured out , you still need to include or link zend framework in your application. I couldn't find any facilities which will make deployment any easier either.
It would be nice if someone could give some pointers / resources about pros/cons of using Zend Server.
Thanks
If the plan is to set up a live server my tip would be to not use the Zend Server CE. It is quite heavy, I would use apache/mysql and then add your ZF dir to include path in the php.ini
I used Zend Server CE on my Mac earlier, just for development, but i throw it out and now i use MAMP instead.
What I liked about Zend Server CE is the admin interface, read more about it here http://www.zend.com/en/products/server-ce/
I am just wondering if I could run CodeIgniter applications on Zend Server Community Edition without any issues.
I don't want to mess everything up by experimenting. Please let me know if you have faced any problems running CI on ZendServer CE.
Thanks
Zend Server isn't really a server. It's just a preconfigured PHP installation for Apache/IIS. When deploying a Zend Framework application, you have to include the Zend Framework libraries along with your application as if you were deploying it on a regular Apache/PHP server.
You can treat it as a stock installation of PHP.
I don't know enough about Zend Server to say for sure (e.g. I've seen someone manage to wedge CI into Joomla before), and while I'm sure it's possible, I imagine it would require a lot of tinkering. What you can do is pick and choose your favorite bits of CI or Zend and reuse the code as libraries. Are you being forced to use Zend but would prefer to use CI? If that's the case, I feel for you, but I'm not sure the best solution is to use two entire frameworks with all the overhead that comes with them...it would probably end up being really unwieldy.