38
PHP Development with Vagrant

Php Development with Vagrant

Embed Size (px)

Citation preview

PHP Development with Vagrant

How do you test your code?

but testing in production sometimes...

but testing in production sometimes...

Let’s test in local machine

Stop bug to be sent to production!

Even tested in local, production was...

The Top 5 replies by programmers when their programs do not work:

The Top 5 replies by programmers when their programs do not work:

5. "Even though it doesn't work, how does it feel?

The Top 5 replies by programmers when their programs do not work:

5. "Even though it doesn't work, how does it feel?4. "You can't use that version on your system."

The Top 5 replies by programmers when their programs do not work:

5. "Even though it doesn't work, how does it feel?4. "You can't use that version on your system."3. "Why do you want to do it that way?"

The Top 5 replies by programmers when their programs do not work:

5. "Even though it doesn't work, how does it feel?4. "You can't use that version on your system."3. "Why do you want to do it that way?"2. "Where were you when the program blew up?"

The Top 5 replies by programmers when their programs do not work:

5. "Even though it doesn't work, how does it feel?4. "You can't use that version on your system."3. "Why do you want to do it that way?"2. "Where were you when the program blew up?"1. "It works on my machine."

Why not working in production !?

Why not working in production !?Apache PHP MySQL

Development(Windows XAMPP)

Apache 2.2ConfigA CDE

PHP 5.5Extension ABCDE

MySQL 5.6Config BC E

Testing / Production(Linux)

Apache 1.6ConfigABC E

PHP 5.3Extension AB D

MySQL 5.4Config ABCD

In 2003, XAMPP 1.0 releasedno solution for “it works in my machine”

History of Information Technology

In 2003, XAMPP 1.0 releasedIn 2007, iPhone 1st generation released

no solution for “it works in my machine”

History of Information Technology

In 2003, XAMPP 1.0 releasedIn 2007, iPhone 1st generation releasedIn 2008, Google Chrome 0.2 released

no solution for “it works in my machine”

History of Information Technology

In 2003, XAMPP 1.0 releasedIn 2007, iPhone 1st generation releasedIn 2008, Google Chrome 0.2 releasedIn 2009, Windows 7 released

no solution for “it works in my machine”

History of Information Technology

In 2003, XAMPP 1.0 releasedIn 2007, iPhone 1st generation releasedIn 2008, Google Chrome 0.2 releasedIn 2009, Windows 7 released

no solution for “it works in my machine” But in 2012,

History of Information Technology

Vagrant Development EnvironmentApache PHP MySQL

Development(Linux on Vagrant)

Apache 2.2ConfigA CDE

PHP 5.5Extension ABCDE

MySQL 5.6Config B DE

Testing / Production(Linux)

Apache 2.2ConfigA CDE

PHP 5.5Extension ABCDE

MySQL 5.6Config B DE

Q. How to setup Vagrant?

1. Download & Install Virtual Box msi2. Download & Install Vagrant msi3. Download .box file (Made by Oikos)4. open cmd, type ‘vagrant up’5. open browser, type localhost:80806. edit your code and see changes in browser!

Q: Do I need FTP to change my code?

No. Set ‘Synced Folders’ in Vagrant.

Your Computer

C:/vagrant/www/website.com/public_html/index.php

Vagrant VM

/home/website.com/www/public_html/index.php

Want to know more?

http://vagrantup.com