"zf" Command Launches Code Editor No Matter What

For programming and general questions on Zend Framework

"zf" Command Launches Code Editor No Matter What

Postby i_banks on Thu Jun 28, 2012 10:33 pm

Hello I'm installing Zend Framework for the first time. I'm new to this as I'm following a book on using the framework. I'm at the beginning where I've installed Apache, MySQL, PHP, and the Zend Framework all on my computer. No I'm not using XAMP or any other bundles. My Zend files are located in C:\apache\htdocs\library\. I created a path variable to the zf files in the bin directory with the variable ZEND_TOOL_INCLUDE_PATH in the environment variables. I know this did something right because before this I was getting the 'zf not recognizable as a command' error.

But now whenever I type in the command line something like 'zf show version' or 'zf create project', it doesn't do anything but launch my code editor (Dreamweaver..which I have to change) and it opens the file 'zf.php'. This is indeed strange. Can I get any assistance with this please?
i_banks
 
Posts: 9
Joined: Thu Jun 28, 2012 10:23 pm

Re: "zf" Command Launches Code Editor No Matter What

Postby us2rn4m2 on Fri Jun 29, 2012 6:05 pm

Hello, (I'm on windows)

1 - Put zf.bin and zf.bat in the php.exe folder
2 - Set php.ini include_path = "C:\path\to\library"
3 - Write to environment variables -> variables system -> path = ;C:\path\to\php.exe;
IMPORTANT: DON'T FORGET THE SEMICOLON !! ( ; )

That's all !
us2rn4m2
 
Posts: 48
Joined: Mon Jun 18, 2012 12:41 am

Re: "zf" Command Launches Code Editor No Matter What

Postby us2rn4m2 on Fri Jun 29, 2012 6:18 pm

Update:
Example for environment variables -> system variables -> path = ;C:\wamp\bin\php\php5.3.5;

This is the path where are php.exe, zf.bat and and zf.php
us2rn4m2
 
Posts: 48
Joined: Mon Jun 18, 2012 12:41 am

Re: "zf" Command Launches Code Editor No Matter What

Postby i_banks on Sun Jul 01, 2012 8:00 am

Thanks for your reply.

This has become a headache. I have two computers, a laptop and a desktop. I originally had AMP setup on both, but when I started running into the Zend setup issues I've mentioned above, I decided to try another route on my laptop and use WAMP only to run into the same exact issue - 'zf' command attempted to open a code editor.

I followed the instructions here: http://framework.zend.com/manual/en/zen ... itool.html as well as your instructions (which were the same really) and I'm still getting the same problem regardless. A fellow coder offered a suggestion that actually worked but not exactly.

He stated:
My first thought is that if running from the command line, you need to actually invoke PHP and pass the zf.php file as the argument:
Code: Select all

> cd \directory\where\zf.php\lives
> php zf.php



When I did this, it laid out the same information in the CLI tool as the command 'zf' would lay out with the exception of an error that reads like this:
Code: Select all
An Error Has Occurred
An action and provider is required.

Zend Framework Command Line Console Tool v1.11.12
Usage:
    zf [--global-opts] action-name [--action-opts] provider-name [--provider-opt
s] [provider parameters ...]
    Note: You may use "?" in any place of the above usage string to ask for more
specific help information.
    Example: "zf ? version" will list all available actions for the version prov
ider.

Providers and their actions:
  Version
    zf show version mode[=mini] name-included[=1]
    Note: There are specialties, use zf show version.? to get specific help on t
hem.

  Config
    zf create config
    zf show config
    zf enable config
    Note: There are specialties, use zf enable config.? to get specific help on
them.
    zf disable config
    Note: There are specialties, use zf disable config.? to get specific help on
them.

  Phpinfo
    zf show phpinfo

  Manifest
    zf show manifest

  Profile
    zf show profile

  Project
    zf create project path name-of-profile file-of-profile
    zf show project
    Note: There are specialties, use zf show project.? to get specific help on t
hem.

  Application
    zf change application.class-name-prefix class-name-prefix

  Model
    zf create model name module

  View
    zf create view controller-name action-name-or-simple-name module

  Controller
    zf create controller name index-action-included[=1] module

  Action
    zf create action name controller-name[=Index] view-included[=1] module

  Module
    zf create module name

  Form
    zf enable form module
    zf create form name module

  Layout
    zf enable layout
    zf disable layout

  DbAdapter
    zf configure db-adapter dsn section-name[=production]

  DbTable
    zf create db-table name actual-table-name module force-overwrite
    Note: There are specialties, use zf create db-table.? to get specific help o
n them.

  ProjectProvider
    zf create project-provider name actions


I'm not even sure what to do at this point. I want to learn Zend and not any other framework.
i_banks
 
Posts: 9
Joined: Thu Jun 28, 2012 10:23 pm

Re: "zf" Command Launches Code Editor No Matter What

Postby i_banks on Sun Jul 01, 2012 6:56 pm

I just tried the suggestions on the computer with the AMP stack and it's doing the same thing. The 'zf' command is still launching the code editor.
i_banks
 
Posts: 9
Joined: Thu Jun 28, 2012 10:23 pm

Re: "zf" Command Launches Code Editor No Matter What

Postby us2rn4m2 on Sun Jul 01, 2012 8:31 pm

Oops, I made a mistake in my first post:
Put zf.bat, zf.php, and zf.sh in the php.exe folder.

Now if the code editor is launching
Give me the (complete) path of:
- wamp
- library
- environment variables -> system variables -> path
- the path where are php.exe, zf.bat, zf.php, zf.sh

and the command that you type
us2rn4m2
 
Posts: 48
Joined: Mon Jun 18, 2012 12:41 am

Re: "zf" Command Launches Code Editor No Matter What

Postby us2rn4m2 on Sun Jul 01, 2012 8:45 pm

Hello, (I'm on windows)

1 - Put zf.bat, zf.php and zf.sh in the php.exe folder
2 - Set php.ini include_path = "C:\path\to\library"
3 - Write to environment variables -> variables system -> path = ;C:\path\to\php.exe;
IMPORTANT: DON'T FORGET THE SEMICOLON !! ( ; )

That's all !
us2rn4m2
 
Posts: 48
Joined: Mon Jun 18, 2012 12:41 am

Re: "zf" Command Launches Code Editor No Matter What

Postby us2rn4m2 on Sun Jul 01, 2012 9:45 pm

Try:
go to C:\wamp\bin\php\php5.3.5
open zf.bat (2 clicks)

If code editor is launching:
right-click on zf.bat
select 'open with' -> 'select programm by default'
and search C:\Windows\system32\cmd.exe
press ok.

open your command line and type:
zf show version
or
zf ?
us2rn4m2
 
Posts: 48
Joined: Mon Jun 18, 2012 12:41 am

Re: "zf" Command Launches Code Editor No Matter What

Postby i_banks on Mon Jul 02, 2012 6:09 am

Thanks for all your assistance. Code editor is still launching after I've followed all of the instructions.

Here's my complete paths and file setup:

Path for Wamp:
- C:\ (path for Wamp)

Path for Zend Library:
- C:\wamp\bin\php\zend_framework\library\Zend (this is for access to files amf, application, barcode, config, dojo..etc)

Path for the "paths" variable in environment variables -> variables system for Windows 7:
- C:\wamp\bin\php\zend_framework\bin; (this is for the zf file access, files are now moved to the path below)
- C:\wamp\bin\php\php5.3.13 (this is for the php.exe access)

Path where are php.exe, zf.bat, zf.php, zf.sh:
- C:\wamp\bin\php\php5.3.13
i_banks
 
Posts: 9
Joined: Thu Jun 28, 2012 10:23 pm

Re: "zf" Command Launches Code Editor No Matter What

Postby us2rn4m2 on Mon Jul 02, 2012 10:46 pm

OK ! Now that I see your paths I think I know why your code editor is still launching !

1 - Your path for Wamp: C:\wamp is OK !
2 - Your path for Zend library: C:\wamp\bin\php\zend_framework\library\Zend is BAD !
- Change like this: C:\wamp\library
- The 'library' folder doesn't exist in C:\wamp but we don't care about that ! Create it manually ! That' all !
Put Zend inside
Now path for Zend = C:\wamp\library\Zend
3 - Your environment variables -> variables system -> Path: C:\wamp\bin\php\zend_framework\bin; is BAD ! Delete it !! You don't need it.
4 - Your environment variables -> variables system -> Path: C:\wamp\bin\php\php5.3.13 is OK !
5 - Your path where are php.exe, zf.bat, zf.php, zf.sh: C:\wamp\bin\php\php5.3.13 is OK !

Resume:
1 - Now your path for Wamp = C:\wamp
2 - Now your path for libary = C:wamp\library
3 - Now your path for Zend = C:wamp\library\Zend
4 - Now your environment variables -> variables system -> Path = ;C:\wamp\bin\php\php5.3.13; (DON'T FORGET SEMICOLONS !!)
5 - Now your path where are php.exe, zf.bat, zf.php, zf.sh = C:\wamp\bin\php\php5.3.13
6 - Now your php.ini include path = "C:wamp\library;"

Now open your command line:
> zf ?
press enter

What you see ? If you see a 'listing' all it' s good !

Now in your command line:
> cd C:\wamp\www
press enter
> zf create project MyFirstProject
press enter

And now go to C:\wamp\www . What you see ?
us2rn4m2
 
Posts: 48
Joined: Mon Jun 18, 2012 12:41 am

Next

Return to Zend Framework

Who is online

Users browsing this forum: No registered users and 7 guests