When building an environment with the above configuration, the host OS and guest OS are often used. When setting up sharing, I got stuck with an error and took about 3 days to resolve I will write what I did.
Since Vagrant related depends on Version I will consciously post the version description as a memorandum.
In translation, it's macOS Mojave. -ProductName: Mac OS X ・ ProductVersion: 10.14.6 ・ BuildVersion: 18G6042
Centralized management of cask with Homevrew ・ Vagrant 2.2.13 ・ Virtualbox 6.1.16,140961
LAMP environment CentOS 7.8 configuration -Apache/2.4.6 (CentOS) ・ PHP 7.3.24 (cli) ・ Mysql Ver 14.14 Distrib 5.7.32
Install Composer
CentOS disables all usual security because it is a local environment ・ SELinux is disabled ・ Firewall invalid
$vagrant ssh
$cd /vagrant
$composer create-project --prefer-dist laravel/laravel laravelsample "6.*"
$cd /var/www/html
$sudo ln -s /vagrant/laravelsample laravelsample
Confirmation. Haste error! !! orz ....
The contents are as follows ↓
A phenomenon that causes an error when creating a log file
What i did
I solved it by setting the execution authority under the project created by Laravel to 777!
I see the article.
$ sudo chmod -R 777 laravelsample
... I can't solve it
It's no good because the owner of the shared folder is not the apache user!
I see the article.
config.vm.synced_folder ".", "/vagrant",
:owner => 'apache',
:group => 'apache',
mount_options: ['dmode=777','fmode=755']
Add
Error when Vagrant up ... orz
... I can't solve it
But the owner and group of the Laravel project directory must be Apache
I understood.
A lot of articles "I solved it by inserting the vagrant-vbguest plugin"
This is the solution! !!
$ vagrant plugin install vagrant-vbguest
... I can't solve it
Apparently, the description rule of config.vm.synced_folder has changed when I investigate.
config.vm.synced_folder ".", "/vagrant",
owner: "apache",
group: "apache"
I saw it! !! !!
It took about 3 days (explosive sweat)
First, read the details of the error carefully and think of a solution. Then reread the official reference.
Written in Japanese, avoiding it because it is in English When I browse the solution, it says It was a lesson.
Let's read English errors properly! See you!