GithubHelp home page GithubHelp logo

guoyu07 / packer-php7-dev Goto Github PK

View Code? Open in Web Editor NEW

This project forked from shies/packer-php7-dev

0.0 0.0 0.0 496 KB

CentOS 7 Packer Vagrant Build for PHP7 Development

Shell 18.27% SaltStack 81.50% PHP 0.23%

packer-php7-dev's Introduction

PHP 7 Development Box

Overview

This repository houses the configuration scripts necessary to build a CentOS 7 based box suitable for PHP7 testing and extension development. Additionally, a Vagrantfile is included that will launch an already built box by downloading it from Atlas should you wish to forego making your own box.

Upon boot, the Vagrant Salt provisioner will:

  • Clone the latest PHP source repository from the master branch
  • Build PHP from source with debug information and gcov enabled
  • Build the extensions necessary to run common PHP frameworks/applications (composer/Symfony2)
  • Installs the compiled PHP binaries as SAPI FPM with opcache
  • Install then configure nginx and PostgreSQL for development testing against the PHP SAPI FPM

There are a number of tutorials provided that detail how to debug PHP extensions amongst other things. See the Tutorials section.

Coming soon: an alternative PHP build for non-debug testing.

Configuration

The configuration is defined in Salt state files. The Salt provisioner can either be run by Packer to generate your own box or by Vagrant to ensure an existing box is running the latest specification. To build the box from scratch yourself, you will require a CentOS 7 ISO that has the minimum software as specified in the kickstarter config or if your internet connection is sufficiently fast you could point Packer to an ISO image to download.

Packer supports producing VirtualBox and VMware images. Currently the Packer configuration specifies an output VirtualBox machine.

If you do not wish to build the box from source, a pre-built VirtualBox image that can be launched with a single command is provided at https://atlas.hashicorp.com/rcousens/boxes/php7-dev-c7. See Quick Setup.

Packer

Packer is a free and open source tool for creating golden images for multiple platforms from a single source configuration.

SaltStack

SaltStack is an extremely fast and scalable systems and configuration management software for predictive orchestration, cloud and data center automation, server provisioning, application deployment and more.

Configuration Files

Anaconda KickStarter

Specifies the CentOS 7 installation options and prepares passwordless sudo for vagrant. See ks.cfg.

Packer Provisioning

Installs VirtualBox Guest additions and cleans up post installation. See scripts directory and packer.json.

Included Components

PHP7

PHP7 is the next major release version of PHP. It includes significant performance improvements and additions to the language.

nginx

Nginx is installed and configured to serve a website from /srv/www/dev/web. The default dev.conf in /etc/nginx/conf.d/dev.conf contains the configuration.

PostgreSQL

PostgreSQL is configured to accept md5 connections from all hosts (I will tighten the security up in the future) with a superuser configured with the login dbuser and password dbuser.


Instructions

Quick Setup

Requirements

Getting Started

Clone this repo into a local directory:

$ git clone https://github.com/rcousens/packer-php7-dev.git

Change directory to where the repo was cloned and launch the vagrant box:

$ vagrant up
From the host machine:
  • nginx is listening on localhost port 10001.
  • PostgreSQL is listening on localhost port 10002.

A phpinfo.php script is copied when provisioning that will execute phpinfo. Open up http://localhost:10001/phpinfo.php in a browser to verify the virtual machine is working and PHP7 has been installed correctly.

To access the virtual machine:
$ vagrant ssh

Build Box Yourself

Requirements

$ cd packer
$ packer build packer.json

Note: you may want to edit the packer.json and point it at a valid CentOS iso.


Things You Can Do

Host a PHP7 website

Install your website under /srv/www/dev/web with a front controller with the filename app.php.

Advanced PHP and Debugging Tutorials

License

MIT

packer-php7-dev's People

Contributors

rcousens avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.