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

Introducing Homestead, the ThinkPHP development environment

藏色散人
Release: 2021-01-22 09:05:24
forward
2881 people have browsed it

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
Copy after login
to the

Homestead.yaml

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

vagrant reload --provision
Copy after login
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!

Related labels:
source:learnku.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template