Home  >  Article  >  PHP Framework  >  Introducing Homestead, the ThinkPHP development environment

Introducing Homestead, the ThinkPHP development environment

藏色散人
藏色散人forward
2021-01-21 11:10:562788browse

The following tutorial column will introduce you to Homestead, the ThinkPHP development environment. I hope it will be helpful to friends in need!

Introducing Homestead, the ThinkPHP development environment

How to build a ThinkPHP development environment

We know that Homestead is one of the officially recommended development environments for Laravel , which consists of the Homestead script of the customized Vagrantfile and the Vagrant box containing PHP development-related software. But Homestead not only supports the quick construction of sites adapted to Laravel, but also supports popular frameworks in PHP such as

symfony

,

zendFramework

, yii , and support ThinkPHP starting from v.7.18.0 (increase the PR of ThinkPHP (https://github.com/laravel/homestead/pull/952)) Framework types supported by the latest version (https://github.com/laravel/homestead/tree/v10.3.1/scripts/site-types)

Configure ThinkPHP site

1. Add

sites:
 - map: thinkphp.test
   to: /home/vagrant/my-thinkphp-project/web
   type: thinkphp
to the

Homestead.yaml

file. 2. Update the Nginx configuration of the virtual machine

vagrant reload --provision
I am using the environment built by the Laravel development environment document in the community. The Homestead version is

7.8.0
. Just add the

type

option and reconfigure it, and it will report If there is no error related to the script, copy the thinkPHP site script (https://github.com/laravel/homestead/blob/v7.18.0/scripts/serve-thinkphp.sh) to the scripts file of homestead , and then vagrant reload --provision can successfully create the ThinkPHP site.                                                                                                                                                                             

The above is the detailed content of Introducing Homestead, the ThinkPHP development environment. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:learnku.com. If there is any infringement, please contact admin@php.cn delete