


When installing the yii2 framework and running initbat, it reports an error that phpexe is not an internal or external command.
When installing the yii2 framework, I encountered a very tangled problem. That is, after I downloaded the installation package, the installation on the company's computer was normal. However, when I installed it on my own computer at home, an error occurred, indicating that php.exe was not an internal or external command, nor was it an operable program. Now, it’s me. After Brother Dong’s guidance, I finally know what’s going on. Because the environment I installed is the green version, php.exe is not filled in the system environment variables. The company's computer probably has a program that automatically adds the php.exe program to the environment variables. After checking, it is indeed there. If you know the reason, let’s actually do it.
Error message:
<ol><li> <span>php</span><span>.</span><span>exe</span><span>不是内部或外部命令,也不是可运行的程序</span> </li></ol>
Solution: I use win7 as an example, and I will figure out the rest by myself.
The first method: directly add php.exe to the system environment variables.
1. First find the address to add environment variables. There are many ways to find the path, I will list two.
1), Desktop->Computer->Advanced system settings.
2) Computer (click to enter the disk management interface)->System Properties (below the menu bar).
2. Following the path above, we easily found the system property settings. Let’s take a look at how to set it up.
1) Text tutorial:
Find the Advanced tab - Environment Variables - System Variables - Find the variable Path, double-click to open - add; after the variable value bin; at the beginning,
Then fill in the file where your installation environment php.exe is located Clip path. Mine is E:UPUPW_NP5.5PHP5.
My correct way of writing is:
<ol><li> <span>...(省略)</span><span>\b</span><span>in</span><span>;</span><span>E</span><span>:</span><span>\UPUPW_NP5</span><span>.</span><span>5</span><span>\PHP5</span><br> </li></ol>
2), picture tutorial:
Through the above picture and text tutorial, it is easy to solve how to add php.exe to Problems in system environment variables. Then let's try executing init.bat again.
Run the cmd command, enter the dos interface, drag init.bat and enter to execute. When the following interface appears, it means that php.exe has been installed in the environment variable.
I won’t say much about the next installation, as another tutorial has already answered it. You can search on the site: yii2 framework installation tutorial, yii2 framework installation.
The above is the method to directly add php.exe to the system environment variable. There is another method, which is the solution that comes with yii2. I feel like they are quite thoughtful.
Second method: When running init.bat of yii2.0.6, it prompts that "php.exe" is not an internal or external command. Solution:
Open init.bat with a text editor to modify
<ol> <li> <span>if</span><span>"%PHP_COMMAND%"</span><span>==</span><span>""</span><span>set</span><span> PHP_COMMAND</span><span>=</span><span> php</span><span>.</span><span>exe</span> </li> <li><span> </span></li> <li><span>改为</span></li> <li><span> </span></li> <li> <span>if</span><span>"%PHP_COMMAND%"</span><span>==</span><span>""</span><span>set</span><span> PHP_COMMAND</span><span>=</span><span>D</span><span>:\</span><span>xampp</span><span>\</span><span>php</span><span>\</span><span>php</span><span>.</span><span>exe</span><span>(填写你自己</span><span>php</span><span>.</span><span>exe</span><span>的实际路径)</span> </li> </ol>
and then rerun in CMD That’s ok!
The above has introduced the yii2 framework installation and running initbat error reporting that phpexe is not an internal or external command, including aspects of the content, I hope it will be helpful to friends who are interested in PHP tutorials.

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











PHP and Python each have their own advantages, and choose according to project requirements. 1.PHP is suitable for web development, especially for rapid development and maintenance of websites. 2. Python is suitable for data science, machine learning and artificial intelligence, with concise syntax and suitable for beginners.

PHP is widely used in e-commerce, content management systems and API development. 1) E-commerce: used for shopping cart function and payment processing. 2) Content management system: used for dynamic content generation and user management. 3) API development: used for RESTful API development and API security. Through performance optimization and best practices, the efficiency and maintainability of PHP applications are improved.

PHP is a scripting language widely used on the server side, especially suitable for web development. 1.PHP can embed HTML, process HTTP requests and responses, and supports a variety of databases. 2.PHP is used to generate dynamic web content, process form data, access databases, etc., with strong community support and open source resources. 3. PHP is an interpreted language, and the execution process includes lexical analysis, grammatical analysis, compilation and execution. 4.PHP can be combined with MySQL for advanced applications such as user registration systems. 5. When debugging PHP, you can use functions such as error_reporting() and var_dump(). 6. Optimize PHP code to use caching mechanisms, optimize database queries and use built-in functions. 7

PHP is still dynamic and still occupies an important position in the field of modern programming. 1) PHP's simplicity and powerful community support make it widely used in web development; 2) Its flexibility and stability make it outstanding in handling web forms, database operations and file processing; 3) PHP is constantly evolving and optimizing, suitable for beginners and experienced developers.

PHP and Python each have their own advantages, and the choice should be based on project requirements. 1.PHP is suitable for web development, with simple syntax and high execution efficiency. 2. Python is suitable for data science and machine learning, with concise syntax and rich libraries.

PHP and Python have their own advantages and disadvantages, and the choice depends on project needs and personal preferences. 1.PHP is suitable for rapid development and maintenance of large-scale web applications. 2. Python dominates the field of data science and machine learning.

PHP is suitable for web development, especially in rapid development and processing dynamic content, but is not good at data science and enterprise-level applications. Compared with Python, PHP has more advantages in web development, but is not as good as Python in the field of data science; compared with Java, PHP performs worse in enterprise-level applications, but is more flexible in web development; compared with JavaScript, PHP is more concise in back-end development, but is not as good as JavaScript in front-end development.

PHP is mainly procedural programming, but also supports object-oriented programming (OOP); Python supports a variety of paradigms, including OOP, functional and procedural programming. PHP is suitable for web development, and Python is suitable for a variety of applications such as data analysis and machine learning.
