Zend Framework Forum

Go Back   Zend Framework Forum > Zend Framework General discussions > General Q&A on Zend Framework

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-15-2009, 01:26 AM
Junior Member
 
Join Date: May 2009
Posts: 11
Exclamation CLI php.exe not found

Hi Guys,
I have started learning Zend Framework 2 days ago. And i had lot of difficulties in installing and configuring it. Actually, i found a quick start tutorial on Zend framework official website.
Now, i am facing problem in using ZEND CLI tool.
I have successfully set a path and created a project using command
zf create project xyz
Now, i need to setup actions in controllers:
According to tutorial i can do it by using command:
zf create action add index
but to do this i should be in xyz/application or xyz directory (not sure ). When i go in directory through command prompt and write the command it gives error that
"PHP.exe is not recognized as internal or external command"
And definitely it is correct because php.exe is in c:\php folder instead of c:\php\xyz folder

Can anybody tell me how can i set actions in C:\php\beta\application\controllers\IndexControlle r.php
I will really be very thankful to you.
Regards,
Umair
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 05-15-2009, 05:30 AM
Senior Member
 
Join Date: Jul 2008
Posts: 288
Default

You don't have to use the CLI tool, but, you need to make sure the php.exe is on your path. So typing "php.exe -v" on the command line should work. Then you won't have any problem.
__________________
Brenton Alker
PHP Developer - Brisbane, Australia

blog.tekerson.com | twitter.com/tekerson | brenton.mp
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 05-15-2009, 06:05 AM
Junior Member
 
Join Date: May 2009
Posts: 11
Default

Quote:
You don't have to use the CLI tool, but, you need to make sure the php.exe is on your path. So typing "php.exe -v" on the command line should work. Then you won't have any problem.
Thank you for your reply. I think that i could not properly ask my question?
Problem:
I can write zf commands when i am in PHP folder (which has php.exe file) but when i try to write a command outside PHP folder, command prompt simply does not recognize or find php.exe file.
Is there any way i can write:
zf create action add index command and it adds the code in xyz project at php\xyz\application\controllers\IndexController.ph p ?

[Off Topic]It's nice to know that you are from Brisbane. I am from Sydney.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 05-15-2009, 09:04 PM
Member
 
Join Date: Nov 2008
Location: San Jose
Posts: 35
Default

Quote:
I can write zf commands when i am in PHP folder (which has php.exe file) but when i try to write a command outside PHP folder, command prompt simply does not recognize or find php.exe file.
Do you have the php.exe path in your environment variables? Try this,
(Assuming your on Windows) Right click on "My Computer"->Properties->Advanced Tab->Environment Variables Button Click It->Look at "System variables"->Under "Path" make sure php.exe is there.

If its not there add it in there. then save the changes and close any command line indow you have open. Then reopen and try again.

This should work for you.
__________________
www.armando.ws
Author: Beginning Zend Framework
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 05-18-2009, 01:36 AM
Junior Member
 
Join Date: May 2009
Posts: 11
Exclamation

Thank you for your reply but it is still not working
php.exe is inside php folder.
I have added following variables in my path: C:\php\;C:\php\beta\library\;C:\php\beta\bin\

In php.ini file which is inside Windows/php.ini i have set include_path as:
include_path = ".;C:/php/beta/library"

Now when i am inside php folder zf command works fine but when i am outside php folder or in a subdirectory it can't recognise php.exe.
I am wondering that is there anything i am missing in configuring CLI?

There is one more question about adding actions in controller. Assuming that CLI zf command is working fine in beta (project directory). If i write
zf create action add index command, will it add the action code automatically inside the IndexController.php file or should i be in beta/application/controllers/ to write this command?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 05-18-2009, 06:48 AM
Member
 
Join Date: Nov 2008
Location: San Jose
Posts: 35
Default

Regarding Question #2:
Quote:
Assuming that CLI zf command is working fine in beta (project directory). If i write
zf create action add index command, will it add the action code automatically inside the IndexController.php file or should i be in beta/application/controllers/ to write this command?
Yes, once you execute that command it will add the code:
public function addAction(){}
You must run the command in the root level of your application. In your example: beta directory.

Concerning the original question:
Where is your php.exe file located? C:\PHP?

Armando Padilla
__________________
www.armando.ws
Author: Beginning Zend Framework
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 05-18-2009, 10:59 PM
Junior Member
 
Join Date: May 2009
Posts: 11
Default

Quote:
Where is your php.exe file located? C:\PHP?
Yes, PHP.exe is located under c:\php.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 05-19-2009, 01:25 AM
Member
 
Join Date: Nov 2008
Location: San Jose
Posts: 35
Default

ok lets start from the beginning.

1. Do you have all the system variables set?
A. System Variable "Path" should have "PATH TO YOUR PHP DIRECTORY" (assuming C:\PHP)
B. System Variable "PHPRC" is set with value "PATH TO YOUR PHP DIRECTORY"

2. Closed all command line windows after making the above changes if any and then reopend the command line window again before typing in zf show version outside the PHP directory.

Try those out see what you get.

Armando Padilla
__________________
www.armando.ws
Author: Beginning Zend Framework
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 05-19-2009, 01:33 AM
Member
 
Join Date: Nov 2008
Location: San Jose
Posts: 35
Default

BTW i wrote this up today.

{ Online Notes } Blog Archive How to set up Zend_Tool on Windows. (no im not spamming :-p )

I started with a fresh clean desktop so hope that helps. If not we'll keep plugging away at the issue. (drives me crazy when i cant figure something out. lol)
__________________
www.armando.ws
Author: Beginning Zend Framework
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 05-19-2009, 05:28 AM
Junior Member
 
Join Date: May 2009
Posts: 11
Smile

Hats off to armandop
You know it took me 5 days to configure CLI. We don't have enough helpful material about installing and configuring Zend on Windows.
Due to some reasons i was not able to see PHPRC in environment variables. I also did not set up ZEND_TOOL_INCLUDE_PATH accurately.
After re-installing PHP using msi installer and following your Blog i was able to fix it properly.
Thanks again.
[Offtopic] It will be great if Admin makes it a sticky post. Because, i know that many people will ask the same question again and again. It will help them out.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT. The time now is 12:01 AM.


Designed by: Miner Skinz Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0