Children's shoes with vagrant virtual machines should know that the native and virtual machine directory mappings can be defined in the Vagrantfile file, such as:
Config.vm.synced_folder ". /WebSite ","/usr/share/nginx/html "
Indicates that the website directory in the current file directory of this machine is mapped to the specified directory of the virtual machine, so that the contents of the directory in the virtual machine are website directories, that is, the directory share is implemented.
This article does not describe how to specify a synchronization directory in Vagrantfile, but instead use catalog mapping to resolve a development environment and local environment compatibility issues.
such as the code for the project on the test server:
Php
Added by MAQG 20100317 Please configure the vip_center and ADMIN_VIP paths according to the situation
$system _folder_vip_prefix = "/data/vhosts/dynamic.xxx.com/";
$system _folder_admin_prefix = "/data/vhosts/admin.vip_center/";
This is a very old project, from the code comments look at 09 years began to build, due to historical reasons, many places are not standard. The path here is written dead, many places are, and the test server file organization is very messy, and some with a chain of soft links to the local, not according to the server directory to build a set of the same, then use Vagrantfile Sync directory can skillfully solve this problem.
For example, the test server dynamic.xxx.com directory files, then the local is in the BBB directory, so you can create a mapping directory in the Vagrantfile file, the dynamic.xxx.com directory map to the local BBB directory, so that in the virtual machine or the original path, but you can access This machine's BBB directory, not to modify the code path to solve the problem?
Similarly, in other places, such a mapping directory, you can not modify the code to achieve the code in different environments compatible.