Home >PHP Framework >YII >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 .
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!