A vagrant development environment focused on PHP development with Symfony 5
To use it, download and install Vagrant, VirtualBox and Git. Clone this repository and run:
git clone https://github.com/mladjom/tbv2.gitcd tbv2vagrant plugin install vagrant-hostsupdater --localvagrant upFor ssh access:
vagrant sshNote: Default preconfigured host is tbv2.test.
- Vagrant 2.2.10+
- Virtualbox 6.1.14
- Git
- 2GB+ of RAM
- Virtualisation ( VT-X ) enabled in the BIOS ( Windows/Linux )
- Hyper-V turned off ( Windows )
- Ubuntu 20.04 LTS (Focal Fossa)
- NGINX
- PHP 8
- MySQL 8
- phpMyAdmin
- Composer
- Symfony CLI
This package ships with a custom.example and hosts.yml.example file in the root of the project.
You must rename those files to just custom and hosts.yml
cp custom.example custom
cp hosts.yml.example hosts.ymlNote: Make sure you have hidden files shown on your system.
You can add virtual hosts to NGINX by editing custom file. The DocumentRoot of the new virtual host will be a directory within the
www/ folder matching the ServerName you specified. The Directory maps to a folder on the host machine.
server {
listen 80;
listen [::]:80;
server_name example.com;
root /var/www/example;
index index.html;
location / {
try_files $uri $uri/ =404;
}
}
In order to access new vagrant hosts via your local browser you will need to edit your hosts file hosts.yml like this:
---
- example.test
To update you will need to reload vagrant with provision flag.
vagrant reload --provisionCreate /www/example folder. Open it in an editor to start making changes to your site.
When it's done, visit http://example.test.
The NGINX server is available at 192.168.33.20
Externally the MySQL server is available at port 8889, and when running on the VM it is available as a socket or at port 3306 as usual.
Username: root
Password: toor
PhpMyadmin is available at 192.168.33.20/phpmyadmin
Username: root
Password: toor
Composer binary is installed globally (to /usr/local/bin), so you can simply call composer from any directory.