![]() |
|
|||
|
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 |
|
|||
|
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 |
|
|||
|
Quote:
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. |
|
|||
|
Quote:
(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. |
|
|||
|
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? |
|
|||
|
Regarding Question #2:
Quote:
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 |
|
|||
|
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 |
|
|||
|
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) |
|
|||
![]() 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. |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
| 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 |
![]() |