In team development, everyone has their own integrated environment, such as WAMP, AppServ, and There is no problem running on it”. So the question is, how to solve this problem?
How to unify the development environment?
Vagrant is a tool used to build a virtual development environment. We can use Vagrant to encapsulate a Linux development environment and distribute it to team members. Members can develop programs on their favorite desktop system (Mac/Windows/Linux), but the code can be run uniformly in a packaged environment, which is very domineering and cool to use.
Vagrant’s best friend
VirtualBox: Claimed to be the most powerful free virtual machine software similar to VM.
Not only is it rich in features, but its performance is also excellent.
How to install?
1. Install VirtualBox:
Website: https://www.virtualbox.org/wiki/Downloads
2. Install Vagrant:
URL: http://downloads.vagrantup.com/
3. Download system image:
Website: http://www.vagrantbox.es/
Just install them one by one in order~
Specific operations
1. Add image to Vagrant:
The image is stored in /home/box/centos65.box
cd/home/box/
vagrant box add centosbox centos65.box
2. Initialize the development environment:
vagrant init centosbox #Initialization
vagrant up #Start environment
3. SSH login:
Use Xshell, Putty, SecureCRT, etc. to log in.
IP: 127.0.0.1
Port: 2222
Username: root
Password: vagrant
Commonly used configurations
After Vagrant is successfully initialized, a Vagrantfile will be generated in the initialization directory, which can be modified for personalized customization.
1. Configure IP:
config.vm.network :private_network, ip: “192.168.33.10”[remove #]
You can change the IP to another address as long as there is no conflict.
2. Configure the synchronization directory:
config.vm.synced_folder “../data”, “/vagrant_data” [remove # and modify it to the following]
config.vm.synced_folder “/home/web/www”, “/data/www“
/home/web/www: local directory
/data/www: Linux server directory
3. Configure virtual memory:
Add the following paragraph before the end character of the file:
config.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--memory", "2048"]
end
Warm reminder: Remember to restart the virtual machine after modifying the configuration.
Package and distribute
When you have configured your development environment, exit and shut down the virtual machine.
Package the development environment in the terminal:
vagrant package
After packaging is completed, a package.box file will be generated in the current directory,
Pass this file to other users,
Other users only need to add this box and use it to initialize their own development directory,
You will get an identical development environment.
Commonly used commands
vagrant init #Initialization
vagrant up #Start the virtual machine
vagrant halt #Close the virtual machine
vagrant reload #Restart the virtual machine
vagrant status #View virtual machine running status
For more [dry information sharing], please pay attention to the PHP engineer subscription account.

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

Dreamweaver CS6
Visual web development tools

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment