Zend CLI Tool include error - php

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.

Related

PHP on Windows Include path for Zend Framework not working

I know this should be real simple, but I can't get Zend Framework to work.
What I did so far:
1 - Downloaded Zend Frame Full
2 - Extracted everything to c:\php\includes\ZendFramework.
3 - Modified the php.ini file so now it shows
;;;;;;;;;;;;;;;;;;;;;;;;;
; Paths and Directories ;
;;;;;;;;;;;;;;;;;;;;;;;;;
; UNIX: "/path1:/path2"
;include_path = ".:/php/includes"
;
; Windows: "\path1;\path2"
include_path = ".;C:\php\includes;C:\php\includes\ZendFramework\library"
4 - Added same info to my 'path' in windows system variable, so now the relevant portions look like:
C:\Program Files (x86)\PHP\v5.4;C:\Program Files\MySQL\MySQL Server 5.5\bin;C:\php\includes;C:\php\includes\ZendFramework\library
I used the Zend InstallationChecker from http://framework.zend.com/svn/framework/standard/trunk/demos/Zend/Gdata/InstallationChecker.php and receive the following response:
Zend Framework Installation Errors Tested
0
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:\php\includes;C:\php\includes\ZendFramework\library
I've read all sorts of install guides and I'm pretty sure I've done everything I was supposed to. Why is this not working?
That installation checker is part of ZF1, but if you downloaded the framework fresh, you've installed ZF2. It's quite possible that everything's installed fine, and it's the installation checker that is broken (as it looks for a file that doesn't exist in ZF2).

Where to place Zend and which path to change?

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.

Zend framework in Xampp

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.

Autoloading classes when not in same directory as zend 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.

Zend Framework create project error

I am new to the Zend Framework. I read the Zend Framework document. Here I saw to work Zend Framework must include the path in my php.ini, I believe that this is done because in my php info I saw include path is C:\www\zend_frame\library
Also in document it says that to create a project I must run:
C:\> zf.bat create project quickstart
I want to create a project in C:\wamp\www
In my command shell I ran:
C:\>wamp\www> zf.bat create project quickstart
But I got an error message (see below).
Then I tried another way:
C:\>wamp\www> C:\wamp\zend_frame\bin\zf.bat create project quickstart
Here I got the same error:
Php.exe is not recognised as an internal or external command, operable program or batch file
I also set the path in My Computer settings
The Zend Framework zf.bat script assumes that it can run "php.exe" without specifying the full path to that executable, and it will be found because you have set your PATH to include that directory:
SET PATH=%PATH%;C:\wamp\bin\php
Depending on the version of WAMP, the php.exe may be in a subdirectory for the version of PHP. In that case you need to use a command something similar to this:
SET PATH=%PATH%;C:\wamp\bin\php\php5.3.0
You should be able to figure it out from here.

Categories