Installing and Configuring ThinkPHP 6.0 with Multi‑Application Support

This guide explains how to install ThinkPHP 6.0 using Composer, add the multi‑application extension, generate modules, configure essential files, install the view engine, run the application in a browser, and resolve common .htaccess issues.

php Courses
php Courses
php Courses
Installing and Configuring ThinkPHP 6.0 with Multi‑Application Support

ThinkPHP has evolved to version 6.x, which introduces a streamlined core and unified usage while requiring PHP 7.1+; it does not support seamless upgrades from 5.1.

Since the official site no longer provides direct downloads, the framework must be installed or updated via Composer. composer create-project topthink/think thinkphpV6.0.5 The default installation creates a single‑application directory structure. For multi‑application projects you need the think-multi-app extension. composer require topthink/think-multi-app Be sure to run the Composer command in the project root; otherwise the extension will not be usable and you may encounter missing controller errors.

Delete the existing app/controller directory and generate a new module (e.g., index) with:

php think build index // index is the module name
// To create an admin module, replace "index" with "admin".

After running the command, the new module appears in the project tree (visible in IDEs such as PhpStorm).

Three core files— BaseController.php, Request.php, and ExceptionHandle.php —can be moved freely, but their namespaces must be updated accordingly, and any changes to class names must be reflected in provider.php.

Install the view engine driver: composer require topthink/think-view Now the application can be accessed via a browser, for example: http://localhost:8010/thinkPHPV6.0.5/public/ (adjust the port as needed).

If you encounter the error "No input file specified.", edit the .htaccess file in the public directory, changing: RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L] to RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1] After correcting the rewrite rule, the application should load correctly.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

BackendPHPInstallationFrameworkComposerThinkPHPMulti-Application
php Courses
Written by

php Courses

php中文网's platform for the latest courses and technical articles, helping PHP learners advance quickly.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.