Home >PHP Framework >YII >How to execute script files under commands in yii

How to execute script files under commands in yii

王林
王林Original
2020-02-20 11:29:563305browse

How to execute script files under commands in yii

The steps to execute the yii script in the php command line are:

1. Create a new script

In the "commands" directory, follow the steps of "HelloController" Create a new controller script file in the format of .php".

Related tutorial recommendations: yii framework

2. Execute the script on the command line

Type "php yii project path/yii" on the command line Controller name/method name", such as "php web/yii hello/index" or directly cd to the yii project root directory (mine is web/), and then "php yii hello/index", as shown in Figures 1 and 2 below .

How to execute script files under commands in yii

How to execute script files under commands in yii

Note: PHP must set environment variables before it can be used like this.

For more programming related content, please pay attention to the Programming Introduction column on the php Chinese website!

The above is the detailed content of How to execute script files under commands in yii. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn