PageRenderTime 60ms CodeModel.GetById 29ms RepoModel.GetById 0ms app.codeStats 0ms

/README.md

https://gitlab.com/scottmetoyer/php-sandbox
Markdown | 282 lines | 191 code | 91 blank | 0 comment | 0 complexity | 84e661bf8b4706421dbf410d790126c7 MD5 | raw file
  1. Scotch Box
  2. ==========
  3. ## Check out the official docs at: [box.scotch.io][16]
  4. ## [Read the getting started article](https://scotch.io/bar-talk/introducing-scotch-box-a-vagrant-lamp-stack-that-just-works)
  5. ## [Read the 2.0 release article](https://scotch.io/bar-talk/announcing-scotch-box-2-0-our-dead-simple-vagrant-lamp-stack-improved)
  6. ## [Read the 2.5 release article](https://scotch.io/bar-talk/announcing-scotch-box-2-5)
  7. ![Scotch Box](https://scotch.io/wp-content/uploads/2015/11/scotch-box-2.5-share.png)
  8. Scotch Box is a preconfigured Vagrant Box with a full array of LAMP Stack features to get you up and running with Vagrant in no time.
  9. A lot of PHP websites and applications dont require much server configuration or overhead at first. This box should have all your needs for doing basic development so you dont have to worry about configuring Vagrant and you can simply focus on your code.
  10. No provisioning tools or setup is really even required with Scotch Box. Since everything is packaged into the box, running vagrant is super fast, youll never have to worry about your environment breaking with updates, and you wont need Internet to code.
  11. ![Scotch Box](https://scotch.io/wp-content/uploads/2015/11/Screen-Shot-2015-11-03-at-1.31.52-PM.png)
  12. ## What and Why
  13. Vagrant is an extremely powerful tool. With Chef or Puppet and Vagrant, you can configure any type of server environment you can think of. The possibilities are endless (especially with Docker in the picture now, too). Speaking candidly though, most the development I do doesn't really stray from a default LAMP stack, and when I have to configure a server, I really am always just setting up a boring typical LAMP stack anyways. **All I really want is PHP 5.6 and a bunch of modules with zero hassle or overhead**.
  14. I used to use this seriously awesome [Vagrant LAMP Stack][1] that I even wrote about [here][2]. The problem with this is it broke a lot. It broke when Vagrant updated, it broke when Chef updated, and it broke when Berkshelf updated. On top of that, I always had problems getting it working on Windows. There are just too many points of failures for what it's purpose was for me - simply just developing locally.
  15. So that's why I decided to build a Vagrant LAMP Box. The box is prepackaged and requires provisioning and no configuration. You simply boot it up and it just works. **It's not for every project, but it sure will help you get straight to it with a lot of them**.
  16. > Are you new to Vagrant? If you're new to Vagrant, check out our [getting started guide with Vagrant][2] article, our [Vagrant Share article][10], and our article on [Laravel’s Vagrant stack Homestead][11]. If you follow the first tutorial, you can just learn the Vagrant commands but use the Scotch Box instead.
  17. ![Scotch Box SSH](https://cask.scotch.io/2014/10/scotch-box-ssh.jpg)
  18. ## Features
  19. ### System Stuff
  20. - Ubuntu 14.04 LTS (Trusty Tahr)
  21. - PHP 5.6
  22. - Ruby 2.2.x
  23. - Vim
  24. - Git
  25. - cURL
  26. - GD and Imagick
  27. - Composer
  28. - Beanstalkd
  29. - Node
  30. - NPM
  31. - Mcrypt
  32. ### Database Stuff
  33. - MySQL
  34. - PostgreSQL
  35. - SQLite
  36. ### Caching Stuff
  37. - Redis
  38. - Memcache and Memcached
  39. ### Node Stuff
  40. - Grunt
  41. - Bower
  42. - Yeoman
  43. - Gulp
  44. - Browsersync
  45. - PM2
  46. ### Laravel Stuff
  47. - Laravel Installer
  48. - Laravel Envoy
  49. - Blackfire Profiler
  50. ### Other Useful Stuff
  51. - No Internet connection required
  52. - PHP Errors turned on
  53. - Laravel and WordPress ready
  54. - Operating System agnostic
  55. - Goodbye XAMPP / WAMP
  56. - New Vagrant version? Update worry free. ScotchBox is very reliable with a lesser chance of breaking with various updates
  57. - Super easy database access and control
  58. - [Virtual host ready](https://scotch.io/bar-talk/announcing-scotch-box-2-0-our-dead-simple-vagrant-lamp-stack-improved#multiple-domains-(virtual-hosts))
  59. - PHP short tags turned on
  60. - H5BPs server configs
  61. - MIT License
  62. ## Get Started
  63. * Download and Install [Vagrant][3]
  64. * Download and Install [VirtualBox][4]
  65. * Clone the Scotch Box [GitHub Repository](https://github.com/scotch-io/scotch-box)
  66. * Run ``` vagrant up ```
  67. * Access Your Project at [http://192.168.33.10/][14]
  68. ## Basic Vagrant Commands
  69. ### Start or resume your server
  70. ```bash
  71. vagrant up
  72. ```
  73. ### Pause your server
  74. ```bash
  75. vagrant suspend
  76. ```
  77. ### Delete your server
  78. ```bash
  79. vagrant destroy
  80. ```
  81. ### SSH into your server
  82. ```bash
  83. vagrant ssh
  84. ```
  85. ## Database Access
  86. ### MySQL
  87. - Hostname: localhost or 127.0.0.1
  88. - Username: root
  89. - Password: root
  90. - Database: scotchbox
  91. ### PostgreSQL
  92. - Hostname: localhost or 127.0.0.1
  93. - Username: root
  94. - Password: root
  95. - Database: scotchbox
  96. - Port: 5432
  97. ### MongoDB
  98. - Hostname: localhost
  99. - Database: scotchbox
  100. - Port: 27017
  101. ## SSH Access
  102. - Hostname: 127.0.0.1:2222
  103. - Username: vagrant
  104. - Password: vagrant
  105. ## Mailcatcher
  106. Just do:
  107. ```
  108. vagrant ssh
  109. mailcatcher --http-ip=0.0.0.0
  110. ```
  111. Then visit:
  112. ```
  113. http://192.168.33.10:1080
  114. ```
  115. ## Updating the Box
  116. Although not necessary, if you want to check for updates, just type:
  117. ```bash
  118. vagrant box outdated
  119. ```
  120. It will tell you if you are running the latest version or not, of the box. If it says you aren't, simply run:
  121. ```bash
  122. vagrant box update
  123. ```
  124. ## Setting a Hostname
  125. If you're like me, you prefer to develop at a domain name versus an IP address. If you want to get rid of the some-what ugly IP address, just add a record like the following example to your computer's host file.
  126. ```bash
  127. 192.168.33.10 whatever-i-want.local
  128. ```
  129. Or if you want "www" to work as well, do:
  130. ```bash
  131. 192.168.33.10 whatever-i-want.local www.whatever-i-want.local
  132. ```
  133. Technically you could also use a Vagrant Plugin like [Vagrant Hostmanager][15] to automatically update your host file when you run Vagrant Up. However, the purpose of Scotch Box is to have as little dependencies as possible so that it's always working when you run "vagrant up".
  134. ## Configuration
  135. You may want to change some of the out-of-the-box configurations for
  136. the various parts that come with Scotch Box. To do so, `vagrant ssh`
  137. into the box, and edit the appropriate file. For example, to change
  138. PHP settings:
  139. vagrant ssh
  140. sudo vim /etc/php5/apache2/conf.d/user.ini
  141. Note that the changes that you make will be for the current running
  142. Scotch Box only. If you `vagrant destroy` and then `vagrant up` your
  143. box again, these manual configuration changes will be lost.
  144. If you prefer to automate your configuration changes so that you can
  145. destroy and re-create boxes as needed, Vagrant allows you to create a
  146. "provision script" that runs as part of `vagrant up`. See the
  147. [Vagrant
  148. documentation](https://docs.vagrantup.com/v2/getting-started/provisioning.html)
  149. for notes. For example, you could add the following line to your
  150. Vagrantfile under the `config.vm.hostname = "scotchbox"` line:
  151. config.vm.provision :shell, path: "bootstrap.sh"
  152. and then create `bootstrap.sh` with the following content in the same
  153. directory as the Vagrantfile:
  154. #!/bin/bash
  155. # Disable Zend OPcache
  156. sed -i 's/;opcache.enable=0/opcache.enable=0/g' /etc/php5/apache2/php.ini
  157. This script will be run each time you `vagrant up`, and it can be run
  158. on an already-up box using `vagrant provision`.
  159. ## PHP7 Install Instructions
  160. ```
  161. sudo apt-get update
  162. sudo add-apt-repository ppa:ondrej/php
  163. sudo apt-get install php7.0
  164. sudo apt-get update
  165. sudo apt-get install php7.0-mysql libapache2-mod-php7.0
  166. sudo a2dismod php5
  167. sudo a2enmod php7.0
  168. sudo apachectl restart
  169. ```
  170. ## The MIT License (MIT)
  171. Copyright (c) 2014-2015 Nicholas Cerminara, scotch.io, LLC
  172. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
  173. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
  174. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  175. [1]: https://github.com/MiniCodeMonkey/Vagrant-LAMP-Stack
  176. [2]: http://scotch.io/tutorials/get-vagrant-up-and-running-in-no-time
  177. [3]: https://www.vagrantup.com/downloads.html
  178. [4]: https://www.virtualbox.org/wiki/Downloads
  179. [5]: http://www.sequelpro.com/
  180. [6]: http://www.navicat.com/
  181. [7]: http://github.com/scotch-io
  182. [8]: http://twitter.com/scotch_io
  183. [9]: https://github.com/smdahlen/vagrant-hostmanager
  184. [10]: http://scotch.io/tutorials/sharing-your-virtual-machine-on-the-web-with-vagrant-share
  185. [11]: http://scotch.io/tutorials/php/getting-started-with-laravel-homestead
  186. [12]: https://www.vagrantup.com/downloads.html
  187. [13]: https://www.virtualbox.org/wiki/Downloads
  188. [14]: http://192.168.33.10/
  189. [15]: https://github.com/smdahlen/vagrant-hostmanager
  190. [16]: http://box.scotch.io
  191. [17]: http://scotch.io/bar-talk/introducing-scotch-box-a-vagrant-lamp-stack-that-just-works