views:

917

answers:

8

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
|  |--public
|  |--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.

A: 

I have the same problem.. I'm running the latest version of Zend Server and the latest realese of zf.bat

It seems "enable" is not an option.. but it is on project quickstart on the official zend webpage. Can't figure that out! :(

please help! thanks :)

Mike Armstrong
I solved the problem, check my answer below.
Petr Peller
A: 

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

Petr Peller
A: 

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

Mike Armstrong
A: 

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.

Frankie-T
A: 

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.

Kristof Dombi
A: 

Thank you Frankie-T

You saved my time

GreenBird

Green Bird
A: 

Thank you for your suggestion.

In my php.ini I had *include_path* set to old zend framework version.

Setting include_path to new version fixed the problem.

Regards Adam

Adam