I just managed to create a project using Zend_Tool, but I am stuck on "second step" - enabling layout.
zf enable layout
leads to:
An Error Has Occurred
Action 'enable' is not a valid action.
This is my folder structure:
|--library
| |--Zend //framework classes in this folder
|
|--bin //command line tool folder
| --zf.sh
| --zf.php
| --zf.exe
|
|--zend_test //my test project folder
| |--application
| |--library
| | --Zend //symlink to ../../library/Zend
| |--pub开发者_StackOverflow社区lic
| |--tests
The library folder is in my include_path. Checked with:
php -i | grep include_path
Note that I was able to create the project with zf create project zend_test
and other actions like show
work.
There are some ppl on the official Zend Framework forum with same problem, but there are no answers.
Thanks for any help.
I solved the problem.
It was coincidence, what led to this error. At first I was unable to even run the tool because I couldn't set include_path
(because of permissions). After that there was a problem with (most likely) out-of-date php. (original question is here)
After few hours of headache I deleted the tool and left ZF for a while. Two days ago I wanted to try that on updated server, but coulnd't find the tool so I downloaded it again. Unfortunatelly (for me) Zend released new version of framework and I extracted only the tool.
Briefly
There was a mismatch in versions of the tool (bin
) and the framework (library
) or possibly the library
folder was corrupted.
Solution
Download and extract the whole ZF again to make sure the versions match and files are not corrupted. Also double check the include_path with php -i | grep include_path
I've download zf.bat from
http://framework.zend.com/svn/framework/standard/trunk/bin/
Revision 21133
This is the latest version, as my zend server... why can't I run commands such as:
zf enable layout
zf configure db-adapter
Zend also comes with XAMPP package. So, it is generally becoming a version mismatch. XAMPP's Zend version may be older. So, just rename or delete the Zend folder in \xampp\php\PEAR. and it will start working.
http://www.satya-weblog.com/2010/11/zend-framework-creating-layout.html
Heey,
I got exatly the same problem with XAMP.
It seems that Frankie-T's idea is good, because I renamed c:\xampp\php\PEAR\Zend to Zend_
and also c:\xampp\php\zf.bat
and c:\xampp\php\zf.php
to zf.bat_ zf.php_
.
Of course I have my ZF library downloaded to c:\xampp\htdocs\zf\
and my Path set to C:\xampp\htdocs\zf\bin;
Now if I run the folloving command, I get this:
C:\xampp\htdocs\login>zf show version
Zend Framework Version: 1.10.5
Now I have zf enable layout
as well.
Hope this helps.
I got the same problem with a xampp 1.7.3 setup. I downloaded the whole Framework again, checked the entries in PATH. The problem stayed the same.
Another Stack Overflow question brought the solution for me, as I encountered another strange behavior of a version mismatch when typing "zf show version".
The problem comes with the xampp installation - it ships with an older version of zend.
You need to override the files in XAMPP/php/PEAR/zend with the ones from the new library you just downloaded.
Hope this helps.
精彩评论