This project sets up a CentOS 7.1 (64bit) virtual machine to run your PHP project in. It mounts your PHP project directory so that you can use your favorite editors to work.
- VirtualBox - Free virtualization software. Download
- Vagrant - Tool for working with VirtualBox images. Download
Host OS | VirtualBox | Vagrant |
---|---|---|
Mac OS X 10.10.5 | 5.0.10 | 1.7.4 |
Ubuntu 14.04 | 4.3.28 | 1.6.5 |
- PHP 5.6 (remi) (or 7.0, 5.5. See group_vars/all.)
- Xdebug
- Zend OPcache
- APCu
- Apache 2.4.6
- vhost setup for your PHP project
- MariaDB 5.5.44
- php_dev and php_test databases
- phpMyAdmin 4.4.15.1
- PHPUnit 5.0
- Composer 1.0-dev
- Git 1.8.3.1
project/ ... your project directory
├── public/ ... web document root
└── vagrant-centos7-php/ ... this repository
If your web document root is not public
folder, but the project folder, try to run the following commands:
$ cd /path/to/project/
$ ln -s . public
$ cd /path/to/project/
$ git clone https://github.com/sjestadt/vagrant-centos7-php.git
$ cd vagrant-centos7-php/
$ vagrant up
- Web
- Port Forwarding: http://localhost:8000/
- IP Address: http://192.168.33.33/
- phpMyAdmin: http://localhost:8000/phpmyadmin/ (root password:
root
)
Here are common commands:
command | description |
---|---|
vagrant up |
starts the virtual machine and provisions it |
vagrant provision |
provisions the vagrant machine |
vagrant suspend |
will save the current running state of the machine and stop it |
vagrant halt |
attempts a graceful shutdown of the machine |
vagrant ssh |
gives you SSH access to the virtual machine |
vagrant destroy |
will destroy the machine |
vagrant status |
shows status of the machine |
vagrant global-status |
shows status of all virtual machines |
- Vagrant Documentation
- Ansible Documentation (We use v1.9.4)
If you look for CentOS6: