Forge Home

9,373 downloads

9,373 latest version

3.5 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 0.1.0 (latest)
released Jun 23rd 2014

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'brandonwamboldt-php', '0.1.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add brandonwamboldt-php
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install brandonwamboldt-php --version 0.1.0

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

brandonwamboldt/php — version 0.1.0 Jun 23rd 2014

Puppet Module: php

This is a Puppet module for managing PHP.

Compatibility

This module was built for use with Ubuntu, and probably won't work with CentOS/RedHat.

Usage - CLI

  • Install the command line client for PHP

    include php::cli
    
  • Configure the PHP command line client with an INI file

    class { 'php::cli':
      ini_source => 'puppet:///path/to/your/php.ini',
    }
    

Usage - FPM

  • Install PHP-FPM

    class { 'php::fpm': }
    
  • Configure PHP-FPM

    class { 'php::fpm':
      log_owner => 'php',
      log_group => 'php',
      error_log => '/var/log/php5-fpm.log',
    }
    
  • Add a pool definition to PHP-FPM

    php::fpm::pool { 'example':
      listen          => '/var/run/php5-fpm.sock',
      pm_status_path  => '/server-status',
      php_admin_flag  => {
        display_errors => 'off',
        log_errors     => 'on'
      },
      php_admin_value => {
        memory_limit        => '128M',
        post_max_size       => '128M',
        upload_max_filesize => '128M'
      },
    }
    
  • Add a custom config file

    php::fpm::confd_file { 'custom.conf':
      ensure => present,
      source => 'puppet:///files/php/custom.conf',
    }
    

Usage - PHPUnit

  • Install PHPUnit

    include php::phpunit
    

Usage - PEAR/PECL

  • Install PEAR/PECL

    include php::pear
    
  • Install a PECL extension

    php::pecl::extension { 'memcache':
      ensure => present,
    }
    
  • Change a PECL config value

    php::pecl::config { 'http_proxy':
      value => "myproxy:8080",
    }
    
  • Install a PEAR package

    php::pear::module { 'PHP_CodeSniffer':
      ensure => present,
    }
    
  • Change a PEAR config value

    php::pear::config { 'http_proxy':
      value => "myproxy:8080",
    }
    

Usage - Composer

Note: by default, Composer is installed to /usr/bin/composer, not /usr/bin/composer.phar.

  • Install Composer

    include php::composer
    
  • Setup a new project

    php::composer::project { '/var/www/html/example.com':
      package => 'symfony/framework-standard-edition',
      version => '2.4.1',
    }