Yii2 Framework installation Run Initbat error Phpexe not internal or external command

Source: Internet
Author: User
When installing the YII2 framework, there is a very tangled problem. is when I downloaded the installation package, in the company's computer installation can be normal, when I go home with their own computer installation on the error, indicating that Php.exe is not internal or external command, is not a program to run. This, but I have, after East brother guidance, finally know what is going on. Because I installed the environment is the green version, so Php.exe did not fill in the system environment variables inside. The company's computer estimated that the program automatically put the Php.exe program in the environment variables inside, after the view is really inside. Know the reason, then the actual operation of it.

Error message:

 
  
  
  1. PHP . EXE is not an internal or external command, nor is it a running program

The solution: I take Win7 as an example, other self-repairing brain.

The first approach: add Php.exe directly to the environment variables of the system.

First, find the address where the environment variable was added. There are many ways to find the path, I list two kinds.

1), desktop, computer--Advanced system settings.

2), computer (click into the Disk Management interface), System Properties (below the menu bar).

Second, according to the above path, we easily found the system property settings. Let's see how it's set up.

1), Text tutorial:

Find Advanced tab-environment variables-system variables-Find the variable path, double-click Open-Add after variable value bin;

Then fill in the folder path where your installation environment Php.exe. Mine is E:\UPUPW_NP5.5\PHP5.

My correct wording is:

 
  
  
  1. ... (omitted) \b inch ; E : \UPUPW_NP5 . 5 \PHP5

2), Picture tutorial:

Through the graphic tutorials above, it is easy to solve the problem of how to add Php.exe to the system environment variables. So we're trying to re-execute init.bat.

Run the cmd command, enter the DOS interface, drag init.bat in, enter to execute. When the following interface appears, the Php.exe is already installed in the environment variable.

The next installation, I will not say more, another tutorial has been answered. Can search in the station:YII2 Framework Installation tutorial,YII2 Framework installation .

The above is the method to add Php.exe directly to the system environment variables, there is a method, is the solution of YII2. Feel like people still think very thoughtful.

The second method: "Php.exe" is not an internal or external command solution when running yii2.0.6 Init.bat:

Open Init.bat Modification with a text editor

 
  
  
  1. if "%php_command%" == "" Set Php_command = PHP . EXE
  2. Switch
  3. if "%php_command%" == "" Set Php_command = D : \ XAMPP \ PHP \ PHP . EXE (fill in your own php. ) EXE the actual path)

Then re-run in CMD is OK!

The above describes the YII2 framework installation and Operation Initbat Error phpexe is not internal or external commands, including the content, I hope that the PHP tutorial interested in a friend helpful.

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.