Setelah kita melakukan instalasi XAMPP dan Composer maka kita melanjutkan dengan instalasi YII 2 menggunakan Composer.
Instalasi YII 2 menggunakan Composer pada XAMPP adalah seperti pada langkah-langkah berikut ini
-
- Dari XAMPP Control Panel menuju shell
- Mencopy dan menjalankan script
Kita masuk ke https://www.yiiframework.com/doc/guide/2.0/en/start-installation dan menyalin script dengan perubahan pada php composer.phar seperti pada gambar di bawah ini
- Hasil menjalankan script
# php composer.phar create-project --prefer-dist yiisoft/yii2-app-basic yii2ku Creating a "yiisoft/yii2-app-basic" project at "./yii2ku" Installing yiisoft/yii2-app-basic (2.0.49) - Installing yiisoft/yii2-app-basic (2.0.49): Extracting archive Created project in D:\xampp74\yii2ku Loading composer repositories with package information Updating dependencies Lock file operations: 86 installs, 0 updates, 0 removals - Locking behat/gherkin (v4.9.0) - Locking bower-asset/bootstrap (v5.2.3) - Locking bower-asset/inputmask (3.3.11) - Locking bower-asset/jquery (3.6.4) - Locking bower-asset/punycode (v1.3.2) - Locking bower-asset/yii2-pjax (2.0.8) - Locking cebe/markdown (1.2.1) - Locking codeception/codeception (4.2.2) - Locking codeception/lib-asserts (1.13.2) - Locking codeception/lib-innerbrowser (1.5.1) - Locking codeception/module-asserts (1.3.1) - Locking codeception/module-filesystem (2.0.2) - Locking codeception/module-yii2 (1.1.5) - Locking codeception/phpunit-wrapper (9.0.9) - Locking codeception/stub (4.0.2) - Locking codeception/verify (3.0.0) - Locking doctrine/deprecations (1.1.2) - Locking doctrine/instantiator (1.5.0) - Locking doctrine/lexer (2.1.0) - Locking egulias/email-validator (3.2.6) - Locking ezyang/htmlpurifier (v4.17.0) - Locking fakerphp/faker (v1.23.0) - Locking guzzlehttp/psr7 (2.6.1) - Locking myclabs/deep-copy (1.11.1) - Locking nikic/php-parser (v4.17.1) - Locking paragonie/random_compat (v9.99.100) - Locking phar-io/manifest (2.0.3) - Locking phar-io/version (3.2.1) - Locking phpspec/php-diff (v1.1.3) - Locking phpunit/php-code-coverage (9.2.29) - Locking phpunit/php-file-iterator (3.0.6) - Locking phpunit/php-invoker (3.1.1) - Locking phpunit/php-text-template (2.0.4) - Locking phpunit/php-timer (5.0.3) - Locking phpunit/phpunit (9.5.28) - Locking psr/container (1.1.2) - Locking psr/event-dispatcher (1.0.0) - Locking psr/http-factory (1.0.2) - Locking psr/http-message (2.0) - Locking psr/log (1.1.4) - Locking ralouphie/getallheaders (3.0.3) - Locking sebastian/cli-parser (1.0.1) - Locking sebastian/code-unit (1.0.8) - Locking sebastian/code-unit-reverse-lookup (2.0.3) - Locking sebastian/comparator (4.0.8) - Locking sebastian/complexity (2.0.2) - Locking sebastian/diff (4.0.5) - Locking sebastian/environment (5.1.5) - Locking sebastian/exporter (4.0.5) - Locking sebastian/global-state (5.0.6) - Locking sebastian/lines-of-code (1.0.3) - Locking sebastian/object-enumerator (4.0.4) - Locking sebastian/object-reflector (2.0.4) - Locking sebastian/recursion-context (4.0.5) - Locking sebastian/resource-operations (3.0.3) - Locking sebastian/type (3.2.1) - Locking sebastian/version (3.0.2) - Locking symfony/browser-kit (v4.2.4) - Locking symfony/console (v5.4.31) - Locking symfony/css-selector (v5.4.26) - Locking symfony/deprecation-contracts (v2.5.2) - Locking symfony/dom-crawler (v4.4.45) - Locking symfony/event-dispatcher (v5.4.26) - Locking symfony/event-dispatcher-contracts (v2.5.2) - Locking symfony/finder (v5.4.27) - Locking symfony/mailer (v5.4.31) - Locking symfony/mime (v5.4.26) - Locking symfony/polyfill-ctype (v1.28.0) - Locking symfony/polyfill-intl-grapheme (v1.28.0) - Locking symfony/polyfill-intl-idn (v1.28.0) - Locking symfony/polyfill-intl-normalizer (v1.28.0) - Locking symfony/polyfill-mbstring (v1.28.0) - Locking symfony/polyfill-php72 (v1.28.0) - Locking symfony/polyfill-php73 (v1.28.0) - Locking symfony/polyfill-php80 (v1.28.0) - Locking symfony/service-contracts (v2.5.2) - Locking symfony/string (v5.4.31) - Locking symfony/yaml (v5.4.31) - Locking theseer/tokenizer (1.2.1) - Locking yiisoft/yii2 (2.0.49.3) - Locking yiisoft/yii2-bootstrap5 (2.0.4) - Locking yiisoft/yii2-composer (2.0.10) - Locking yiisoft/yii2-debug (2.1.25) - Locking yiisoft/yii2-faker (2.0.5) - Locking yiisoft/yii2-gii (2.2.6) - Locking yiisoft/yii2-symfonymailer (2.0.4) Writing lock file Installing dependencies from lock file (including require-dev) Package operations: 86 installs, 0 updates, 0 removals - Installing yiisoft/yii2-composer (2.0.10): Extracting archive - Installing behat/gherkin (v4.9.0): Extracting archive - Installing bower-asset/jquery (3.6.4): Extracting archive - Installing bower-asset/inputmask (3.3.11): Extracting archive - Installing bower-asset/punycode (v1.3.2): Extracting archive - Installing bower-asset/yii2-pjax (2.0.8): Extracting archive - Installing cebe/markdown (1.2.1): Extracting archive - Installing sebastian/version (3.0.2): Extracting archive - Installing sebastian/type (3.2.1): Extracting archive - Installing sebastian/resource-operations (3.0.3): Extracting archive - Installing sebastian/recursion-context (4.0.5): Extracting archive - Installing sebastian/object-reflector (2.0.4): Extracting archive - Installing sebastian/object-enumerator (4.0.4): Extracting archive - Installing sebastian/global-state (5.0.6): Extracting archive - Installing sebastian/exporter (4.0.5): Extracting archive - Installing sebastian/environment (5.1.5): Extracting archive - Installing sebastian/diff (4.0.5): Extracting archive - Installing sebastian/comparator (4.0.8): Extracting archive - Installing sebastian/code-unit (1.0.8): Extracting archive - Installing sebastian/cli-parser (1.0.1): Extracting archive - Installing phpunit/php-timer (5.0.3): Extracting archive - Installing phpunit/php-text-template (2.0.4): Extracting archive - Installing phpunit/php-invoker (3.1.1): Extracting archive - Installing phpunit/php-file-iterator (3.0.6): Extracting archive - Installing theseer/tokenizer (1.2.1): Extracting archive - Installing nikic/php-parser (v4.17.1): Extracting archive - Installing sebastian/lines-of-code (1.0.3): Extracting archive - Installing sebastian/complexity (2.0.2): Extracting archive - Installing sebastian/code-unit-reverse-lookup (2.0.3): Extracting archive - Installing phpunit/php-code-coverage (9.2.29): Extracting archive - Installing phar-io/version (3.2.1): Extracting archive - Installing phar-io/manifest (2.0.3): Extracting archive - Installing myclabs/deep-copy (1.11.1): Extracting archive - Installing symfony/polyfill-mbstring (v1.28.0): Extracting archive - Installing doctrine/instantiator (1.5.0): Extracting archive - Installing phpunit/phpunit (9.5.28): Extracting archive - Installing codeception/phpunit-wrapper (9.0.9): Extracting archive - Installing codeception/lib-asserts (1.13.2): Extracting archive - Installing symfony/polyfill-ctype (v1.28.0): Extracting archive - Installing symfony/deprecation-contracts (v2.5.2): Extracting archive - Installing symfony/yaml (v5.4.31): Extracting archive - Installing symfony/polyfill-php80 (v1.28.0): Extracting archive - Installing symfony/finder (v5.4.27): Extracting archive - Installing psr/event-dispatcher (1.0.0): Extracting archive - Installing symfony/event-dispatcher-contracts (v2.5.2): Extracting archive - Installing symfony/event-dispatcher (v5.4.26): Extracting archive - Installing symfony/css-selector (v5.4.26): Extracting archive - Installing symfony/polyfill-intl-normalizer (v1.28.0): Extracting archive - Installing symfony/polyfill-intl-grapheme (v1.28.0): Extracting archive - Installing symfony/string (v5.4.31): Extracting archive - Installing psr/container (1.1.2): Extracting archive - Installing symfony/service-contracts (v2.5.2): Extracting archive - Installing symfony/polyfill-php73 (v1.28.0): Extracting archive - Installing symfony/console (v5.4.31): Extracting archive - Installing ralouphie/getallheaders (3.0.3): Extracting archive - Installing psr/http-message (2.0): Extracting archive - Installing psr/http-factory (1.0.2): Extracting archive - Installing guzzlehttp/psr7 (2.6.1): Extracting archive - Installing codeception/stub (4.0.2): Extracting archive - Installing codeception/codeception (4.2.2): Extracting archive - Installing codeception/module-asserts (1.3.1): Extracting archive - Installing codeception/module-filesystem (2.0.2): Extracting archive - Installing symfony/dom-crawler (v4.4.45): Extracting archive - Installing symfony/browser-kit (v4.2.4): Extracting archive - Installing codeception/lib-innerbrowser (1.5.1): Extracting archive - Installing codeception/module-yii2 (1.1.5): Extracting archive - Installing codeception/verify (3.0.0): Extracting archive - Installing doctrine/deprecations (1.1.2): Extracting archive - Installing symfony/polyfill-php72 (v1.28.0): Extracting archive - Installing symfony/polyfill-intl-idn (v1.28.0): Extracting archive - Installing doctrine/lexer (2.1.0): Extracting archive - Installing egulias/email-validator (3.2.6): Extracting archive - Installing ezyang/htmlpurifier (v4.17.0): Extracting archive - Installing paragonie/random_compat (v9.99.100): Extracting archive - Installing psr/log (1.1.4): Extracting archive - Installing symfony/mime (v5.4.26): Extracting archive - Installing yiisoft/yii2 (2.0.49.3): Extracting archive - Installing bower-asset/bootstrap (v5.2.3): Extracting archive - Installing yiisoft/yii2-bootstrap5 (2.0.4): Extracting archive - Installing yiisoft/yii2-debug (2.1.25): Extracting archive - Installing fakerphp/faker (v1.23.0): Extracting archive - Installing yiisoft/yii2-faker (2.0.5): Extracting archive - Installing phpspec/php-diff (v1.1.3): Extracting archive - Installing yiisoft/yii2-gii (2.2.6): Extracting archive - Installing symfony/mailer (v5.4.31): Extracting archive - Installing yiisoft/yii2-symfonymailer (2.0.4): Extracting archive 27 package suggestions were added by new dependencies, use `composer suggest` to see details. Generating autoload files 56 packages you are using are looking for funding. Use the `composer fund` command to find out more! No security vulnerability advisories found. > yii\composer\Installer::postCreateProject chmod('runtime', 0777)...done. chmod('web/assets', 0777)...done. chmod('yii', 0755)...done. > yii\composer\Installer::postInstall Lenovo@GRACIA-LENOVO d:\xampp74
- Update konfigurasi httpd.conf
- Restart XAMPP
- Halaman-halaman yang terbentuk
- Dari XAMPP Control Panel menuju shell
Instalasi YII 2 menggunakan Composer pada XAMPP