LoginSignup
4

More than 5 years have passed since last update.

vagrantを使ってのsymfony環境構築

Last updated at Posted at 2016-08-11

1. Install VirtualBox.

2. Install Vagrant.

2.terminal

2-1 vagrant box add in my pc

$ vagrant box add centos67 https://github.com/CommanderK5/packer-centos-template/releases/download/0.6.7/vagrant-centos-6.7.box

2-2 vagrant box check

$ vagrant box list

2-3 change the folder

$ cd XXXXXXXXX
XXXXXXXXX is your folder name.

2-3 make the vagrant init file

$ vagrant init centos67

2-4 open the vagrant files and delete the '#' ipsetting

・before
'# config.vm.network "private_network", ip: "192.168.33.10"
・after
config.vm.network "private_network", ip: "192.168.33.10"

2-5 exist

$ vagrant up

2-6 open ssh

$ vagrant ssh

3 seting ssh

3-1 git install

sudo yum -y install git

3-2 clone packege

git clone https://github.com/dotinstallres/centos65.git

3-3 change path

cd centos65

3-4 exist

./run.sh

3-5 exit

exit

3-6 reload

$ vagrant reload

4 symfony setting

5-1

$ vagrant ssh

5-2 composer install

$ sudo curl -LsS https://symfony.com/installer -o /usr/local/bin/symfony

5-2 setting chmod

$ sudo chmod a+x /usr/local/bin/symfony

5-3-1 Latest symfony install 

$ symfony new my_project
※plese change my_project name

5-3-2 Decide symfony version install

$ symfony new my_project 2.8
※plese change my_project name and version number.

5-4

$ cd my_project
※plese change  my_project your folder name.

5-5 check is current path

$ pwd
example [/home/vagrant/my_project]

5-5 check is ip address.

$ ip a
example[
~
inet 192.168.33.10/24 brd 192.168.33.255 scope global eth1
~
]

5-6 symfony run.

$ php bin/console server:run 192.168.33.10

5-7 check symfony on web browser.

192.168.33.10

finish !!

warning

※「$」はターミナル コピーの際につけない.
※「symfony2」を参考。謝意
基本からしっかり学ぶ Symfony2入門

※ドットインストールを参考。謝意
http://dotinstall.com/

symfony本家を参考。謝意
https://symfony.com/

Let's try!!

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4