1. Download the Composer-setup.exe first: download composer. will automatically search the Php.exe installation path, if not, manually find the PHP path under the Php.exe.
2. In the PHP directory, open the php.ini file and turn on the OpenSSL extension. Remove the semicolon in front of the Extension=php_openssl.dll (;)
3. Add the PHP directory to the environment variable (and the path to the Php.exe sibling directory) For example: D:\apache_php\php is added to the environment variable path.
4. Download Composer.phar,:composer.phar. Put the Composer.phar file in the PHP directory, create a new file in the PHP directory composer.cmd, the content is written: @php "%~dp0composer.phar"%* save. Run this file, and then open cmd run: Composer will appear
You can run composer--version to view the version of composer.
5. Execute at the command line:composer config -g repo.packagist composer https://packagist.phpcomposer.com
Get the WWW directory installed after phpstudy under the Yii2
Official Document: Http://www.yiichina.com/doc/guide/2.0/start-installation
In the WWW directory, press shift right to open cmd and run the next command.
Composer Create-project--prefer-dist yiisoft/yii2-app-advanced file name
Install the index.php file when the download is complete
Open File CD file name
Let's post init.
Installation of composer and YII2 installation in Windows environment