I downloaded and extracted Zend Framework and it is inside a folder named ZendFramework-2.0.6.
Documentation says that I need to change php.ini - include_path line.
I hope - this is that line (unchanged): include_path = ".;C:\xampp\php\PEAR"
On this page, accepted answer says that i shouldn't change this path (if I understand well).
Could someone clarify where I should place ZendFramework-2.0.6 folder, which path and how I need to change it ?
I'm using xampp 1.8.1.
It's completely up to you but it is a common practice to place it into the vendor directory.
However, I recommend using composer for installation as it automatically installs dependencies and configures your autoloading. It's surely a good idea to start with the Skeleton Application, the README.md explains the installation process with composer.
You don't need to change the include_path in this case.
Related
I recently downloaded the full package version(recommended) of ZendFramework(2.0.5).And tried and failed to install in xampp(version 1.7.4) also my php version is 5.3.5 .
I have done almost everything that is said to do like-
1.find php.ini and add path
include_path = ".;C:\xampp\php\Zend\library\zend\;C:\xampp\php\PEAR;"
2.Extract the downloaded Zend Framework folder and copy to your PHP include path.
I have also checked the folder(xampp,php,Zend) permissions too.I have checked and rechecked my tries multiple times but that error is not solved.
Exception thrown trying to access Zend/Loader.php using 'use_include_path' = true. Make sure you include Zend Framework in your include_path which currently contains: .;C:\xampp\php\Zend\library\zend\;C:\xampp\php\PEAR;
It has already taken mine whole day to check other forums,get ideas but none of then works.Please help .Thanks
Your path should probably be C:\xampp\zend\library\Zend.
You shoulnd't take the framework to the global include path but have it as a dependency in your project, soon you'll have two projects with two different versions of ZF and then the global option creates troubles
Hi there finally after doing every possible tries,my error was gone.
I don't know other cases but in my case i have done a series of mistake.So as i corrected them the error was gone.Here is what i did
1.In ZendFramework-2.0.5 the loader.php was missing.So following error occured
Exception thrown trying to access Zend/Loader.php using 'use_include_path' = true. Make sure you include Zend Framework in your include_path which currently contains: .;C:\xampp\php\Zend\library\zend\;C:\xampp\php\PEAR;
For this i downloaded the ZendFramework-1.12.0(only in my case).And Loader.php was there
2.No two mistake of mine was i fractured the path from half.
i.e.If my folder structure was like
ZendFramework-1.12.0/library/Zend/..I add the half path to php.ini file
include_path = ".;C:\xampp\php\PEAR\;C:\xampp\php\Zend;"
which was a mistake so i, gave the path before the library folder
include_path = ".;C:\xampp\php\PEAR\;C:\xampp\php\Zend\library;"
and placed the folders according to path.
3.And what about environmental variables i read about?
They are not neccessary while installing the ZendFramework for the first time.After it i am not in that condn to say whether it should be added or not environmantal variables
C:\xampp\php
So,after doing above mentioned corrections and checking through the installation checker the error was gone.
And remember to restart(start and stop) the apache server after a tiny change in php.ini file.
thanks to markus-tharkun and Seth Battin a lot.You saved me.
I'm trying to install Zend_Tools.
I tried the solutions in other questions but anything worked.
I'm using Windows7 with XAMPP therefore my php lies in C:\xampp\php.
I included php into PATH, added my ZendFramework\library to include_path.
I have some other php installations on my system but I think I included it right. php -i | more gives:
Loaded Configuration File => C:\xampp\php\php.ini
and
Zend Extension => 220090626
Zend Extension Build => API220090626,TS,VC9
Now, when I try to run zf.bat. I get the error:
ZF Error:In order to run the zf command, you need to ensure that Zend Framework
is inside your include_path...
I also added an echo of get_include_path() i the top of zf.php it also gives me the right path:
.;C:\xampp\php\PEAR;C:\Users\Felix_2\Documents\programmierung\ZendFramework\libr
ary;C:\Users\Felix_2\Documents\programmierung\ZendFramework\library
In the ZendFramework\library folders is one folder "Zend" with Zend's packages as subfolders, thats the right folder, isn't it?br/>
Don't know how to get this working.
You need to add that Zend folder to your path. So it should be ......ZendFramework/library/Zend that should fix it.
Should ZF and PHP have the same path to include in php.ini, or can they be put in separate directories? This is the include path in my php.ini:
;Windows: "\path1;\path2"
include_path = ".;C:\xampp\php\PEAR;C:\ZF\library\"
I couldn't find any Zend documents that specify which, copying ZF\library to xampp\php\PEAR or the entire ZF directory, or using multiple include paths, is recommended for MVC app production. Is there a good practice or does it depend more on not having access to a certain part of a server or if you are using shared hosting, combining PHP and ZF would be the better option?
Should ZF and PHP have the same path to include in php.ini, or can
they be put in separate directories?
It is fine to have multiple directories listed in your php.ini.
include_path = ".;C:\xampp\php\PEAR;C:\ZF\library\"
The following would be better:
include_path = "C:\xampp\php\PEAR;C:\ZF\library\"
In other words, you don't need the "." in your path since anything that needs to be included in the current working directory can be included like this "./path/to/file.php".
Furthermore, you will want to use an autoloader but having the autoloader search ".", is more work than is needed.
Finally, I generally have an include path of:
include_path = "C:\xampp\php\PEAR"
The reason is that since PHPUnit is generally installed via the PEAR installer, I always want that globally available; however, for everything else, I can wait until I have access to a PSR-0 compliant autoloader.
Hope that helps.
i've been suggested to use the ZFDotrine from a post here but right now it turns out to be kind of headache where i don't know why zf can't see the zfdoctrine provider.
I have a kind of shady environment on my windows 7.i have xampp 1.7.3 and zend server5.0.2 on my machine each with a different version of zf.so i downloaded zf 1.10.8 under drive c (C:\ZendFramework) and referenced its bin in the environment variable path, and its library in php.ini. i've removed c:/xampp/php/PEAR/zend folder and c:/xampp/php/zf.bar | zf.php. i also have netbeans 6.9 created the zf.ini for me.After some issue with NetBeansCommandsProvider i got everything working fine, from command line tool project create to tool from netbeans.
xamp/php.ini
include_path = ".;C:\xampp\php\PEAR;C:\ZendFramework\library;"
zendserver/php.ini
include_path=".;C:\ZendFramework\library"
in zf.ini i have change php.includepath to php.include_path
php.include_path = "C:\ZendFramework\library;.;C:\Users\sensei\ .netbeans\6.9\zend;C:\ZFDoctrine;"
basicloader.classes.0 = "NetBeansCommandsProvider"
So with ZFDoctrine physically under C and referenced in zf.ini i thougth everything would work out but i'm having errors
Failed opening 'ZFDoctrine\Tool\DoctrineProvider.php' for inclusion (include_path='.;C:\xampp\php\PEAR;C:\ZendFramework\library;C:\ZFDoctrine;') in C:\ZendFramework\library\Zend\Loader.php on line 147
for the command zf enable config.provider ZFDoctrine_Tool_DoctrineProvider
Apparently when i copy ZFDoctrine folder to C:\ZendFramework\library\zend\ it works.that makes me realize there is something wrong with the include_path.
i'm thinking also about copying it to the PEAR folder but that too, i don't know if that's the best way to go.I just don't understand why it can't find the ZFDoctrine folder.
I'm kinda stuck.Please has anyone successfully using this to share his experience with me?Can you point out what i'm not doing right? thanks for reading this.this is a kind of blocker to me
Zend_Tool uses the include path in zf.ini, so it's this one you need to double check:
php.include_path = "C:\ZendFramework\library;.;C:\Users\sensei\ .netbeans\6.9\zend;C:\ZFDoctrine;"
What is the correct full path to DoctrineProvider.php? At the moment it's looking for:
C:\ZFDoctrine\ZFDoctrine\Tool\DoctrineProvider.php
which doesn't look right. Assuming you've extracted the full ZFDoctrine to C:\ZFDoctrine, then should it be:
php.include_path = "C:\ZendFramework\library;.;C:\Users\sensei\ .netbeans\6.9\zend;C:\ZFDoctrine\library;"
I've decided that rather than have a copy of the Zend Framework in each application's directory, I'd like to keep it on one location on the server, with the one copy used by all my websites. However, I'd like my app's custom classes to still be within the application folder. So a folder structure a bit like this:
webroot
|...library
| |......Zend
|
|...app1
| |.....Library
| |.......App1
|
|...app2
|.....Library
|.......App2
How can I get Zend Loader to automatically find the classes in App1 and App2? (preferably by just changing something in application.ini or bootstrap.php)
You can create a single library directory, with symlinks to the actual live shared code:
webroot/library/Zend -> /path/to/Zend/library/Zend
webroot/library/App1 -> /path/to/App1/library/App1
webroot/library/App2 -> /path/to/App2/library/App2
Then, you only need webroot/library in your path.
To handle version updates, you can simply change the symlink to point to a new install:
webroot/library/Zend -> /path/to/Zend-test/library/Zend
The Zend Loader will use your php include_path to find files to load.
Simply add webroot/library to your include_path (which you can either do in php.ini or in your bootstrap) and the autoloader should be able to find the framework.
If you are keen to have a shared version of Zend you may as well just use pear (http://pear.zfcampus.org/) to install it and then as long as you have your include_path set to look in your pear dir ( /usr/share/php on my machine ) then you are good to go.
I would advise only to do this for dev machines though, as others have said it's a good idea to be able to control the versions of zend for each app when in production.