📜  yii3 install - Shell-Bash (1)

📅  最后修改于: 2023-12-03 14:48:41.134000             🧑  作者: Mango

Yii3 Install - Shell/Bash

Yii3 is a popular PHP framework for developing web applications, and installing it can be done easily through the command line using Shell/Bash. This tutorial will guide you through the steps on how to install Yii3 on your system.

Prerequisites

Before installing Yii3, you need to ensure that your system meets the following prerequisites:

  • PHP 7.4 or later
  • MySQL or PostgreSQL database
  • Composer

If you don't have any of these prerequisites installed, make sure to install them before proceeding with the Yii3 installation.

Step 1 - Create a new Yii3 project

To create a new Yii3 project, run the following command:

composer create-project --prefer-dist yiisoft/app my-app-name

This command will create a new Yii3 project in a directory named my-app-name. You can change this directory name to your desired name.

Step 2 - Run the migration

To run the migration and create the necessary database tables, run the following command:

cd my-app-name
./yii migrate/up

This command will create the necessary tables in your MySQL or PostgreSQL database.

Step 3 - Serve the application

To serve the application, run the following command:

./yii serve

This command will start the PHP built-in web server on http://localhost:8080. You can access your application by visiting this URL in your web browser.

Conclusion

Congratulations! You have successfully installed Yii3 on your system using Shell/Bash commands. With Yii3, you can start building your web applications quickly and easily. Happy coding!