how to create webapp with yiic command using Yii F

2019-05-08 02:54发布

I'm trying to build my first app in Yii, the guide on their website at the following address: http://www.yiiframework.com/doc/guide/1.1/he/quickstart.first-app # add-comment The problem is that any issue installing the application framework through the YIIC can not have that. I did the following: 1. I went through the CMD Library of the framework that is my WAMP server. 2. I wrote the following command: yiic.php webapp www/blog, I also tried the following command: yiic webapp www/blog.

As I understand their guide, should there be a directory called blog with a skeleton application. What actually happens is that windows opens me the window titled "Open With" asking me to choose which program I want to open the yiic.php to view the contents of the file.

标签: yii
7条回答
不美不萌又怎样
2楼-- · 2019-05-08 03:19

1-Used command prompt/DOS and go to the cd c:\wamp\www\yii\framework. Here "yii" folder has the yii files.

2-Then type yiic webapp ../../yiimyapp. Here yiimyapp is my new folder in the www folder of wamp.

3-After that it will ask to confirm to create the app in the www folder. Type yes and enter.

4-App will be created. Go to the www folder and you can see newly created "yiimyapp" folder with files.

If you need to create the app inside the yii/demos folder just type yiic webapp ../demos/yiimyapp in the above step 2. Then app folder will create inside the yii demos folder. not as separate folder in the www root.

That's only.

查看更多
Fickle 薄情
3楼-- · 2019-05-08 03:23

This manual for installing yii 2.0from this link.

查看更多
We Are One
4楼-- · 2019-05-08 03:29

It's always better to follow yii official documentation. You can find Installing Yii process step by step here

documentation> tutorial > The Yii Blog Tutorial > Testdriving with Yii # Installing Yii

here is the link http://www.yiiframework.com/doc/blog/1.1/en/start.testdrive#installing-yii


If you getting this kind of error when you try to use yiic webapp ..\app-name

'"php.exe"' is not recognized as an internal or external command, operable program or batch file.

Open the yiic.bat file under yii framework folder ( C:\wamp\www\framework ) and change the bellow line

if "%PHP_COMMAND%" == "" set PHP_COMMAND=php.exe

to

if "%PHP_COMMAND%" == "" set PHP_COMMAND=C:\wamp\bin\php\php5.4.16\php.exe

php5.4.16 this might be change accroding to you php version, please check in C:\wamp\bin\php folder before change

or else you can set this path variable as Environment Variable ( Control Panel\All Control Panel Items\System > advance system settings > Environment Variable ) what you have to do is add this C:\wamp\bin\php\php5.4.16\php.exe with ; after path value like bellow image

enter image description here

查看更多
甜甜的少女心
5楼-- · 2019-05-08 03:32

On windows you just go to your framework folder and type:

yiic webapp pathToYourNewProject

yiic will default to yiic.bat so you don't need to specify any php.exe (I'm not saying that it wouldn't work like that). and path to your new project can be relative or absolute, here are some examples:

-- C:
   |
   -- sandbox/
     |
     --yii/
     | |
     | --framework/
     |   |
     |   --yiic.bat (for Window)
     |   --yiic.php (for Linux)
     --newWebApp/

To create on Windows i use:

cd c:\sandbox\yii\framework
yiic webapp ../../newWebApp
type yes when prompted and you're done

or

cd c:\sandbox\yii\framework
yiic webapp c:\sandbox\newWebApp
type yes when prompted and you're done

To create on Linux:

cd /media/sf_sandbox/yii/framework/
./yiic webapp ../../newWebApp
查看更多
霸刀☆藐视天下
6楼-- · 2019-05-08 03:35

The command for creating project is

yiic webapp test

in wich test is the project name.

For more details check this link

http://dcageek.blogspot.com/2013/06/how-to-install-yii-framework-on-windows.html

查看更多
趁早两清
7楼-- · 2019-05-08 03:37

Also if you face the problem after adding the php engine path in environment variable by computer properties .directly you can add the yii.bat location by "C:\wamp\www\Yii\framework" The location I given as a example means my yii framework bat file located at C:\wamp\www\Yii\framework

Above can be done through by going to : Start -> My Computer (right click!) -> Advanced Tab -> Environment Variables -> Click Path in System variables -> Edit.

for more details How to Install Yii Application

查看更多
登录 后发表回答