How to create a webapp using the yiic command using the Yii Framework

I am trying to create my first application in Yii, a guide on my website at the following address: http://www.yiiframework.com/doc/guide/1.1/he/quickstart.first-app # add a comment The problem is that any problem setting the application infrastructure through the YIIC cannot be like that. I did the following: 1. I went through the CMD structure library, which 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 a block with a skeletal application. What actually happens is that the windows open a window for me called "Open with" asking me to choose which program I want to open yiic.php to view the contents of the file.

+4
source share
7 answers

In windows, you simply go to the framework folder and type:

yiic webapp pathToYourNewProject 

yiic will use yiic.bat by default, so you do not need to specify any php.exe (I am not saying that it will not work like that). and the path to your new project can be relative or absolute, here are a few 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 

Create on Linux:

 cd /media/sf_sandbox/yii/framework/ ./yiic webapp ../../newWebApp 
+8
source

It is always best to follow yii's official documentation. Here you can find "Installing the Yii Process" here

documentation> tutorial> Yii Blog Tutorial> Testing with Yii # Installing Yii

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


If you get this error when trying to use yiic webapp .. \ app-name

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

Open the yiic.bat file in the yii frame folder ( C: \ wamp \ www \ framework ) and change the line below

 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 may be a change related to your version of PHP, please check the folder C: \ wamp \ bin \ php before changing

otherwise, you can set this path variable as an environment variable (control panel \ All control panel elements \ system> system presets> environment variable) what you need to do is add C: \ wamp \ bin \ php \ php5.4.16 \ php. exe s ; after the way . as shown below.

enter image description here

+3
source

I think you are on Windows? He should know that php files must be opened using php.exe, so you need to call php.exe yiic.php webapp www/blog .

To ensure this, they also added yiic.bat, so you can just call yiic webapp www/blog if php.exe is in your environment path. If not, maybe you can also add it (computer, properties, advanced settings, environment variables) so that you can run php scripts faster in the future.

0
source

Team to create a project

 yiic webapp test 

in which the test is the name of the project.

See link for more details.

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

0
source

Also, if you encounter a problem after adding the path to the php file in the environment variable using the computer properties. You can directly add the yii.bat location using "C: \ wamp \ www \ Yii \ framework". The place I gave as an example means my bat yii framework file located at C: \ wamp \ www \ Yii \ framework

You can perform the following actions: Start → My computer (right-click!) → Advanced tab → Environment variables → Click Path in system variables → Change.

for more details How to install the Yii application

0
source

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

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

3. After that, he will ask you to confirm the creation of the application in the www folder. Enter yes and enter.

A 4-app will be created. Go to the www folder and you will see a new folder "yiimyapp" with the files.

If you need to create the application in the yii / demos folder, just type yiic webapp ../ demos / yiimyapp in the previous step 2. Then the application folder will create the yii demos folder. not as a separate folder in the www root directory.

It's just.

0
source

This is the yii 2.0 installation yii 2.0 from this link .

0
source

Source: https://habr.com/ru/post/1438235/


All Articles