Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Lightweight PHP development environment with Foreman and built-in server

088b1b43ff5dd64aa0f000da9e9da777?s=47 wtnabe
July 18, 2015

Lightweight PHP development environment with Foreman and built-in server

088b1b43ff5dd64aa0f000da9e9da777?s=128

wtnabe

July 18, 2015
Tweet

Transcript

  1. Lightweight PHP dev-env with Foreman and built-in server @wtnabe Kanazawa.rb

    meetup #35 2015-07-18 (Sat) at DMM.com Labo
  2. Today's Topics Foreman PHP's built-in server for Legacy PHP

  3. Foreman

  4. Process Manager ddollar/foreman can install with rubygems invoke processes &

    attach them to console configured with Procfile kill all processes with ^C developed by Heroku's naka-no-hito
  5. Procfile's format define processes you want to control foreman(1) -

    manage Procfile-based applications <process type>: <command> ex) web: php -S localhost:3000 postgres: postgresql -D db redis: redis-server
  6. with Heroku Heroku reserves web type for HTTP Router

  7. PHP's built-in server

  8. after PHP 5.4 trait and use ( like Ruby's module

    ! ) shorthand array syntax [] built-in web server <?= always available remove call-time pass by reference, register globals, safe mode, etc
  9. see Release Note http://php.net/releases/5_4_0.php

  10. -S option -S <addr>:<port> Run with built-in web server ex)

    like Rails $ php -S localhost:3000
  11. for Legacy PHP

  12. Legacy PHP No Frameworks invoke scripts directly 'current working directory'

    is dirname(script)
  13. You need Router router.php for built-in server and ultra legacy

    env & code PHP: Internal (built-in) functions - Manual
  14. One more thing

  15. Windows Foreman does not work ( I believe ) Use

    forego ddollar/forego requirements golang
  16. Ganbare

  17. You don't need VM any more ! any more ?

  18. Enjoy !