+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11

Thread: CLI php.exe not found

  1. #1
    umair862 is offline 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

  2. #2
    Tekerson is offline 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

  3. #3
    umair862 is offline Junior Member
    Join Date
    May 2009
    Posts
    11

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

  4. #4
    armandop is offline Member
    Join Date
    Nov 2008
    Location
    San Jose
    Posts
    35

    Default

    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

  5. #5
    umair862 is offline 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?

  6. #6
    armandop is offline Member
    Join Date
    Nov 2008
    Location
    San Jose
    Posts
    35

    Default

    Regarding Question #2:
    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

  7. #7
    umair862 is offline Junior Member
    Join Date
    May 2009
    Posts
    11

    Default

    Where is your php.exe file located? C:\PHP?
    Yes, PHP.exe is located under c:\php.

  8. #8
    armandop is offline 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

  9. #9
    armandop is offline 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

  10. #10
    umair862 is offline 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.

+ Reply to Thread
Page 1 of 2 1 2 LastLast

Similar Threads

  1. Classes not being found?
    By deerly in forum General Q&A on Zend Framework
    Replies: 2
    Last Post: 07-04-2009, 08:27 AM
  2. Not Found The requested URL / was not found on this server conf
    By nandana in forum General Q&A on Zend Framework
    Replies: 2
    Last Post: 03-16-2009, 03:10 PM
  3. Helper Not Found
    By bpat1434 in forum Model-View-Controller (MVC)
    Replies: 2
    Last Post: 07-18-2008, 09:20 PM
  4. ACL resource not found
    By shaileshpatel in forum Authentication & Authorization
    Replies: 0
    Last Post: 06-17-2008, 06:46 AM
  5. Class not found
    By thathoo in forum Installation & Configuration
    Replies: 0
    Last Post: 07-20-2007, 10:18 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts