Skip to main content

Yii

On this site, you find a guide to install Yii on CloudPanel.

Creating a Yii Site

Via CloudPanel

  1. Click on + Add Site and then click on Create a PHP Site.
Create a PHP Site
  1. Select the Application Yii 2, enter Domain Name, Site User, Site User Password, and click on Create.
Create a Yii Site

Via CloudPanel CLI

If you like the command line, you can create a Yii Site with the following command as root user.

clpctl site:add:php --domainName=www.domain.com --phpVersion=8.3 --vhostTemplate='Yii 2' --siteUser='john-doe' --siteUserPassword='!secretPassword!'

Creating a Yii Project

  1. Log in via SSH with the Site User:
ssh john-doe@server-ip-address
  1. Go to htdocs and delete the directory which CloudPanel has created:
cd htdocs && rm -rf www.domain.com
  1. Create a Yii Project via Composer:
php8.3 /usr/local/bin/composer create-project --prefer-dist yiisoft/yii2-app-basic www.domain.com
  1. Done! Yii has been installed.
Welcome to Yii Site