zend framework install issue with include_path - zend-framework

I am trying to install Zend Framework for the first time, I am running WAMP. I downloaded the file and unzipped it and moved it into C:\wamp\bin\php\
I added the path to the library into the environmental variables. Variable Name: path, Variable Value: C:\wamp\bin\php\zend_framework\library
I verified the php.ini file in use through the php_info(). I opened it and set the path to the zend library.
include_path = ".;C:\wamp\bin\php\zend_framework\library;C:\wamp\bin\php\PEAR-1.9.4;"
When I open a cmd line and type zf, I get this:
************** ZF ERROR *****************
In order to run the zf command, you need to ensure that Zend Framework
is inside your include_path. There are a variety of ways that you can
ensure that this zf command line tool knows where the Zend Framework
library is on your system, but not all of them can be described here.
The easiest way to get the zf command running is to give it the include
path via an environment variable ZEND_TOOL_INCLUDE_PATH or
ZEND_TOOL_INCLUDE_PATH_PREPEND with the proper include path to use,
then run the command "zf --setup". This command is designed to create
a storage location for your user, as well as create the zf.ini file
that the zf command will consult in order to run properly on your
system.
Example you would run:
$ ZEND_TOOL_INCLUDE_PATH=/path/to/library zf --setup
Your are encourged to read more in the link that follows.
Zend_Tool & CLI Setup Information
(available via the command line "zf --info")
* Home directory found in environment variable HOMEPATH with value \Users\TOS
H
* Storage directory assumed in home directory at location \Users\TOSH/.zf/
* Storage directory does not exist at \Users\TOSH/.zf/
* Config file assumed in home directory at location \Users\TOSH/.zf.ini
* Config file does not exist at \Users\TOSH/.zf.ini
To change the setup of this tool, run: "zf --setup"
php -i works from the cmd line.
OS: Windows 7 64bit
PHP v. 5.3.9
Apache 2.2.21
Any ideas?

php.ini for CLI is different from the one you open using wamp which is for webserver (apache)
C:\wamp\bin\apache\Apache2.2.21\bin\php.ini
you should add include_path in following ini aswell
C:\wamp\bin\php\php5.3.10\php.ini
Note
depending upon your versions of php , apache path could be little different.

Related

Pack a Zend Framework app and deploy it on Zend Server

I created a small Zend Framework application from command prompt using Zend_Tool.
I deployed it in apache server htdocs folder and it is running fine.
Now I need to deploy it to Zend Server. For that i used a command zdpack pack appname.
While trying that i am getting lot of errors like
deployment.xml is missing
I created it in the app root folder.
Then i got
appnaama/data folder is missing error
I created a data folder.
Then
zend-scripts missing
error....
Please help me in deploying an applicaiton created from zf create project projname in Zend server and run it in the browser.
You need to come out of the directory when calling zdpack pack command. If you pack the file inside the project directory you get the "deployment.xml is missing" error.
Pass the following commands at the location where you are creating the
zpk file. For illustration, I will be doing it in the myapp folder of my desktop.
C:\Users\lura\Desktop\myapp> zdpack.exe create demoapp
Move into the directory using cd demoapp and list the directory. Copy your php codes into the data folder. The scripts folder and deployment.xml file can be left as it is. Next run the validate command when inside the directory.
C:\Users\lura\Desktop\myapp\demoapp> zdpack.exe validate --schema="C:\Program Files (x86)\Zend\ZendServer\share\deployment.xsd" deployment.xml
now you can move a folder back with the command cd .. and execute the following.
C:\Users\lura\Desktop\myapp>zdpack pack demoapp
That's it! The zpk file is created! A screenshot of my cmd.
This YouTube tutorial will help, if your still confused. To execute on Linux and for more info read this documentation from zend.
You are using zdpack command wrong!
Step 1: Open shell and ls or cd into the zend workspace.
Step 2: use "zdpack create <ProjectName>" command. It will create deployment.xml, data and script directories. Refresh project explorer you will see changes.
Step 3: Configure deployment.xml if needed.
Step 4: Use "zdpack pack <ProjectName>" command to create zpk file.
That's all.
I think you just pass incorrect path to the app.
Try following this scheme:
zdpack pack <path>/ProjectName
to generate required files.
Step 1: Create skeleton from the zend server zdpack command
#/usr/local/zend/bin/zdpack create <project-name>
It will create project skeleton.
Step 2: Configure deployment.xml if needed.After that check your Deployment.xml is valid.
# /usr/local/zend/bin/zdpack validate --schema="/usr/local/zend/share/deployment.xsd" deployment.xml
Step 3: Now create the zpk file for the aplication
# /usr/local/zend/bin/zdpack pack <project-name>

Zf Tool cannot find Zend Framework

Just started working with the Zend Framework Zf Tool and I've already come across a problem I've spent hours trying to figure out.
For some reason when I run the Zf show version command I get a ZF ERROR indicating it cant find the Zend Framework a to add it to my php.ini include_directory.
Here is my setup. I'm currently have WAMP installed on my local machine.
c:\wamp
I copied the zf.bat and zf.php files into the servers php directory. The path to the php directory has been added to the path environment variable. I'm pretty sure it works because I run the zf show version command in the console and get a ZF ERROR.
I keep my copy of the Zend Framework inside
c:\wamp\includes
So I added this to the php.ini include_path. include_path = ".;c:\wamp\includes"
I checked that this setting was set correctly by checking phpinfo() function. Which shows
include_path .;c:\wamp\includes .;c:\wamp\includes
So I think I have everything setup correctly. I can't work out what I'm missing.
I also tried setting the ZEND_TOOL_INCLUDE_PATH with no success.
Any help would be appreciated. PS I did check other posts here but none of the suggested
I have worked it out! Finally. The way I have my local wamp setup there is 2 php.ini files I have to edit.
The one that made the different is the php.ini inside the Apache2 directory.
Thanks everyone for their help. I appreciate it.
Well im not sure how you downloaded installed the framework but my guess is that you dont have enough of you include path based on the way Zend release packages are constructed. The Zend folder contained in the Zend Framework installation needs its parent folder to be on the include path so typically you would add something like:
c:\wamp\includes\ZF_BASE_DIR\library
This is because the zf package structure looks like:
ZendFramework-VERSION/
README.txt
INSTALL.txt
LICENSE.txt
bin/
library/
If you extracted ZF from the archive you will get a Zend-some_version folder, but the actual ZF is in
"include_path\Zend-some_version\library\Zend", so your include path should point include_path\Zend-some_version\library\
Just to add to what Tjorriemorrie said and to explain in detail how I got my installation on win 7 to work as simply as possible:
Download your preferred Zend package from "http://framework.zend.com/downloads/latest" to "C:\wamp\www\"
unzip your zip file so that you have the extracted Zend folder (with version name) under "C:\wamp\www\".
Rename your folder by removing the version so that you end up with "C:\wamp\www\ZendFramework"
Run a simple php file with phpinfo() in your browser. Note the entries for: "_SERVER["PATH"]" under PHP Variables
"Path" under Environment
"Loaded Configuration File" at the top
"include_path" under Core and
"extension_dir" under Core as well.
"_SERVER["PATH"]" and "Path" must be identical (no brainer)
There should be only one listing for your apache server and that should be the listing under "Loaded Configuration File" but without the "php.ini". So, if your "Loaded Configuration File" is "C:\wamp\bin\apache\apache2.2.22\bin\php.ini" you must have "C:\wamp\bin\apache\apache2.2.22\bin" in your path and that must be the ONLY reference to an apache server. If you have multiple references to apache servers Windows may pick the wrong one depending on your PATH order and use the wrong php.ini file.
Your "extension_dir" will tell you the version and location of php you are using. It is common to have different php folders lying around such as "C:\php", "C:\wamp\bin\php\php5.4.3", "C:\wamp\bin\php\php5.3....", etc. The extension directory will tell you which one of these php folders ZF will "reference" when it is looking for its library. For example, if your extension directory says "c:/wamp/bin/php/php5.4.3/ext/", you want to focus on "c:/wamp/bin/php/php5.4.3"
Go back to your PATH and a) add the string for this php version and b) remove all the other references to the other php folders
Now that you know your running and primary php and apache folders, shutdown (do not restart), shut down your computer and boot back up (restart does not always let the PATH completely reset.
Go to BOTH php.ini files at a) "C:\wamp\bin\apache\apache2.x.y\bin" and "C:\wamp\bin\php\php5.4.3" and find the include_path variable for Windows
Replace the default line, which looks like:
;include_path = ".;c:\php\includes;"
with
include_path = ".;c:\php\includes;C:\wamp\www\ZendFramework\library"
ON BOTH FILES just as Tjorriemorrie notes.
Restart All Services by clicking the wamp icon and selecting said option
At this point my zf tool was working. But, just to be safe, shut down and bootup
Smile and grab a beer!

did I set include_path correctly for zend framework?

I'm trying to get my feet wet with the Zend Framework here. I'm following the beginner's guide ebook and it asks me to add the Zend Framework to my include path in php.ini file
I had already xampp installed and from what I gathered I can just unpack my zf in either xampp\php or xampp\php\PEAR. I figured I'd install it in xampp\php\PEAR
Then I changed the include path in the php.ini file into
; Windows: "\path1;\path2"
;include_path = ".;c:\php\includes"
;
; PHP's default setting for include_path is ".;/path/to/php/pear"
; http://php.net/include-path
include_path = ".library;C:\xampp\php\PEAR;C:\xampp\php\PEAR\ZendFramework-1.11.5\library"
I got this from http://normankosmal.com/wordpress/?p=47 but then adjusted to my current path of course.
Then I need to use the windows command line and here's what I insert
C:\>xampp\php\pear\zendframework-1.11.5\bin\zf.bat
error follows "php.exe" is not recognized as an internal or external command, operable program or batch file.
This isn't an issue with PHP's ìnclude_path; it's an issue with the %PATH% environment variable. The path to the php.exe executable (C:\xampp\php) needs to be added to the environment variable if you want to be able to call php without specifying its full path.

trouble configuring zend framework with netbeans 6.9!

i am new to zend framework. i am trying to create a zend framework project in netbeans 6.9. but the ide shows some error, i couldn't understand. the following are the screenshots that could illustrate my problem.
the following are the error message shown in the ide log:
***************************** ZF ERROR ********************************
In order to run the zf command, you need to ensure that Zend Framework
is inside your include_path. There are a variety of ways that you can
ensure that this zf command line tool knows where the Zend Framework
library is on your system, but not all of them can be described here.
The easiest way to get the zf command running is to give it the include
path via an environment variable ZEND_TOOL_INCLUDE_PATH or
ZEND_TOOL_INCLUDE_PATH_PREPEND with the proper include path to use,
then run the command "zf --setup". This command is designed to create
a storage location for your user, as well as create the zf.ini file
that the zf command will consult in order to run properly on your
system.
Example you would run:
$ ZEND_TOOL_INCLUDE_PATH=/path/to/library zf --setup
Your are encourged to read more in the link that follows.
Zend_Tool & CLI Setup Information
(available via the command line "zf --info")
* Home directory found in environment variable HOMEPATH with value \Documents and Settings\oandz
* Storage directory assumed in home directory at location \Documents and Settings\oandz/.zf/
* Storage directory does not exist at \Documents and Settings\oandz/.zf/
* Config file assumed in home directory at location \Documents and Settings\oandz/.zf.ini
* Config file does not exist at \Documents and Settings\oandz/.zf.ini
To change the setup of this tool, run: "zf --setup"
can any one give the procedure to set-up zend framework and to configure it with netbeans 6.9 starting from scratch.
thanks in advance.
It looks like the cli Zend_Tool isn't being called. I'm not a windows man so the best I can provide is a link Using the CLI Tool there's a section on setting up in Windows.
The images are quite small so I'm guessing a bit but it looks like you pointed netbeans at the zf.bat file, are the permissions correct?
i resolved the problem. the problem is with zend framework 1.10.x itself. i just downloaded the latest version of the zend frame work and it just worked fine.

Error when register provider Zend in Netbeans 6.9

I install :
netbeans 6.9 on 'C:\Program
Files\NetBeans 6.9'
xampp 1.7.2 on D:\xampp
i have upgrade zend through pear
I follow the screencast and when clicking the Register Provider button. But I get message like this:
on create config tab
Successfully written Zend Tool config.
It is located at: \Documents and Settings\Permana/.zf.ini
on enable.config.provider NetbeansCommandsProvider
User has no config file.
An Error Has Occurred
Client has no persistent configuration.
Zend Framework Command Line Console Tool v1.10.7
Details for action "Enable" and provider "Config"
zf enable config.manifest class-name
zf enable config.provider class-name
And of course because of this error I cannot create zend project using netbeans. Did anyone know what is the problem?
Windows XP:
Make sure the environment variable ZF_HOME is set.
I found the soltution to this problem. Just delete the /home/username/.zf.ini and go to netbeans and register zendframework provider again. This will generate zf.ini file in your home directory with new path.
Yesterday I had the same problema. I wrote a post in my blog:
http://otroblogmas.com/error-zend-tool-netbeanscommandsprovider-php/
I found two solutions: either modify the file zf.ini in your profile, or copy the file NetBeansCommandsProvider.php in a path of include_path.
Ubuntu 10.10, NetBeans 6.9.1, Zend Framework 1.11
Reconfigurar
Edit PHP.ini
include_path = ".:/opt/lampp/etc/library" ; Files "/opt/lampp/etc/library/Zend"
gedit /etc/profile
export PATH=$PATH:/opt/lampp/bin # Includer zf.php and zf.sh
export PATH=$PATH:/opt/lampp/etc/library
Remove zf.ini and register NetBeans provider again (from Tools > Options > PHP > Zend).
The above answers are correct, however in my case there was no zf.ini file under my user directory (using Windows 7). In that case you need to run two commands:
zf --setup storage-directory
zf --setup config-file
That will create your zf.ini file and the storage directory under your user directory. Source: here