GithubHelp home page GithubHelp logo

voxpupuli / puppet-php Goto Github PK

View Code? Open in Web Editor NEW
87.0 58.0 267.0 1.6 MB

Generic Puppet module to manage PHP on many platforms

Home Page: http://forge.puppet.com/puppet/php

License: MIT License

Ruby 39.12% Puppet 48.40% HTML 12.34% Pascal 0.14%
bsd-puppet-module linux-puppet-module puppet hacktoberfest archlinux-puppet-module centos-puppet-module debian-puppet-module freebsd-puppet-module redhat-puppet-module sles-puppet-module

puppet-php's People

Contributors

alexjfisher avatar amateo avatar bastelfreak avatar codec avatar dbeckham avatar dhollinger avatar dhoppe avatar ekohl avatar fdammeke avatar fpletz avatar globin avatar igalic avatar jippi avatar jkroepke avatar juniorsysadmin avatar kenyon avatar mbrodala avatar miranovy avatar mmoll avatar mpdude avatar nyholm avatar q-storm avatar rnelson0 avatar root-expert avatar simonhoenscheid avatar smortex avatar tuxmea avatar xalopp avatar yastupin avatar zilchms avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

puppet-php's Issues

Pecl version can't be set

If you use Hiera with php extensions you can't properly set a version number for an extension, you instead have to manually add the php extension to your manifest with a specific module version. This is due to using the ensure from the main php module. I suggest using a different variable for setting the individual module versions so that it can be pulled in from hiera correctly. I will look at it later if I have time and maybe submit a pull request, but I'm also not sure how you'd best like to solve this so maybe I should wait for a fix from your side.

Mechanism to enable extensions compiled in the php main package

In Debian I need to enable pdo extension. This extension is not provided in a separate package. It is compiled in the main php package.

I have the same case in CentOS, where curl is compiled in the main package and there's not any php-curl package.

Currently, php::extensions is conceived to install and enable an extension. I think it needs to change and allow to skip the installation process. Will you accept a PR in this line? Perhaps I'm missing something here?

wrong memcached path on centos

When i start php-fpm, i see error about path of extension:

Starting php-fpm: [02-Sep-2014 16:49:00] NOTICE: PHP message: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/memcached.so' - /usr/lib64/php/modules/memcached.so: cannot open shared object file: No such file or directory in Unknown on line 0

But file nave name without 'd' letter!
[root@new production]# ls -l /usr/lib64/php/modules/memcache.so
-rwxr-xr-x. 1 root root 98536 Jun 22 2012 /usr/lib64/php/modules/memcache.so

It's because path generate from title!
'pecl' => concat(["set .anon/extension '${tittle}.so'"], $config),
Need to parametrized this point.

Defining package_name for php packages

Hi,
is there a way to define a full package name of the php packages?
We are using the IUS repo for the the latest php packages. The default php package is called php56u the common package is php56u-common is there a way to override the default package name php which can only be customized regarding the prefix?

Thanks in advance,
mat1010

php::settings does not allow merging hierarchies

The class "php" does not allow for Hiera data "php::settings" hierarchy merging, due to usage of automatic parameter lookup. Within the "init.pp" file there is the following line, however the variable "$real_settings" is never used.

103   # FIXME: for deep merging support we need a explicit hash lookup instead of
104   #        automatic parameter lookup
105   #        (https://tickets.puppetlabs.com/browse/HI-118)
106   $real_settings = hiera_hash('php::settings', $settings)

It looks like this needs to be moved just below the "validate_*" function calls, and then pass this variable in instead of "$settings", e.g:

 73   if $fpm {
 74     Anchor['php::begin'] ->
 75       class { '::php::fpm':
 76         settings => $real_settings,
 77       } ->
 78     Anchor['php::end']
 79   }

Missing cli parameter on init

The README and CHANGELOG make reference to a "cli" parameter to disable CLI support. However, init.pp doesn't actually have that parameter. Using the example from the README gives the following error:

Error: Invalid parameter cli on Class[Php] at /etc/puppet/manifests/foobarbaz.pp:123

Ensure extension settings prefix

Currently extension settings have to specified like this:

php::extensions:
  apc:
    package_prefix: php-
    settings:
      apc.stat: 1
      apc.stat_ctime: 1

A bit more intuitive and de-duplicating would be this:

php::extensions:
  apc:
    package_prefix: php-
    settings:
      stat: 1
      stat_ctime: 1

To provide the still-required extension prefix, the prefix() function from puppetlabs-stdlib could be used but in that case existing configuration would lead to something like apc.apc.stat and break. Thus a separate function could be necessary to only add the prefix if not present.

Any opinions if this is worth adding?

Bump puppetlabs/stdlib version to >=4.2?

Hi,

you are using the union-function from stdlib. This function is available since v4.2. I had an old stdlib (v4.1) installed and ran into an error. Maybe you should reflect this in your metadata.json file?

Cheers,
Patryk

php-fpm.conf settings through hiera

README shows this
php::fpm::config:log_level: notice

But that didn't work, had to use this:
php::fpm::config::log_level: notice

double colons after config.

php settings are misplaced on RHEL7

I assume php::settings hiera should populate /etc/php.ini

php::settings:
  PHP/expose_php: Off

Instead it creates file /etc/php-cli.ini, which should be managed by php::cli::settings

I have PE 3.3 on RHEL7

Cannot alias Package[pecl-memcached] to ["memcached"]

Howdy,

i'm getting the following error:

Evaluation Error: Error while evaluating a Resource Statement, 
Cannot alias Package[pecl-memcached] to ["memcached"] at xxx/modules/php/manifests/extension.pp:90; 
resource ["Package", "memcached"] already declared at xxx

I have a Memcached-Server installed (same package name). Can i somehow prevent this naming convention conflict?

Thanks,
Patryk

Compatibility to current puppetlabs/stdlib releases

At https://github.com/Mayflower/puppet-php/blob/cleanup-backward-compat-break/manifests/extension.pp#L80 the function ensure_packages() is used with 2 parameters, which is only supported in the current git master of https://github.com/puppetlabs/puppetlabs-stdlib.

The latest version from the forge, 4.1.0, has just one parameter, namely the list of packages, and the PE supported version 3.2.1 lacks the ensure_packages() function altogether.

We should refactor this to either support 4.1.0 or 3.2.1. I vote for 4.1.0. 🐐

composer handling

Create a utility for composer to:

  • install composer packages globally (e.g PHPUnit)
  • run composer install/update in a directory to handle project dependencies

fpm_package_suffix should be just fpm on Red Hat systems

Hi,

I noticed that fpm_package_suffix is 'php-fpm' in params.pp when for RHEL based systems (at least mine on RHEL 6.5) it should be just be 'fpm':

# rpm -qi php-fpm
Name        : php-fpm                      Relocations: (not relocatable)
Version     : 5.3.3                             Vendor: Red Hat, Inc.
Release     : 40.el6_6                      Build Date: Thu 23 Oct 2014 11:06:56 GMT
Install Date: Thu 15 Jan 2015 17:51:11 GMT      Build Host: x86-022.build.eng.bos.redhat.com
Group       : Development/Languages         Source RPM: php-5.3.3-40.el6_6.src.rpm
Size        : 3363344                          License: PHP
Signature   : RSA/8, Wed 29 Oct 2014 16:25:08 GMT, Key ID 199e2f91fd431d51
Packager    : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>
URL         : http://www.php.net/
Summary     : PHP FastCGI Process Manager
Description :
PHP-FPM (FastCGI Process Manager) is an alternative PHP FastCGI
implementation with some additional features useful for sites of
any size, especially busier sites.

Rgds,

Craig.

php-fpm settings through hiera

Hi, first of all thanks for the module :)

I had to change this in php/manifests/fpm.pp
-- $real_settings = deep_merge($settings, hiera_hash('::php::fpm::settings', {}))
++ $real_settings = deep_merge($settings, hiera_hash('php::fpm::settings', {}))

in order for this to work through hiera:
php::fpm::settings:
PHP/max_file_uploads: '4'
Session/session.cookie_secure: '1'

Is there's something I'm doing wrong?

Dependency to "curl"

Hey,

i know this should be really unlikely but i have a machine without "curl" installed. So i got:

Error: Could not find command 'curl'
Error: /Stage[main]/Php::Repo::Debian/Exec[add_dotdeb_key]/returns: change from notrun to 0 failed: Could not find command 'curl'
Notice: /Stage[main]/Php::Repo::Debian/Apt::Source[source_php_wheezy-php56]/File[source_php_wheezy-php56.list]: Dependency Exec[add_dotdeb_key] has failures: true
Warning: /Stage[main]/Php::Repo::Debian/Apt::Source[source_php_wheezy-php56]/File[source_php_wheezy-php56.list]: Skipping because of failed dependencies

Cheers,
Patryk

apache2 mod_php php.ini support

Hi,
pls create a resource at startup to let us easy use php::config:.setting :D for now i put this into my profile, but it would be better at the module itself ;)
OR
pls bring apache2/php.ini support ;)

Unable to set extensions as "zend_extension"

Currently, it is not possible to change the extension = ... line that puppet-php inserts into the extension-name.ini file. When you want to install something like xdebug, for example, you need to change extension = ... to zend_extension = ....

I currently override the contents of that file on every provision, but ideally, I'd not want to have to do that.

can't configure systemd_interval in php-fpm.conf (PHP 5.5.0+)

In PHP 5.5.0 release a new configuration item was added to php-fpm.conf file:

; When FPM is build with systemd integration, specify the interval,
; in second, between health report notification to systemd.
; Set to 0 to disable.
; Available Units: s(econds), m(inutes), h(ours)
; Default Unit: seconds
; Default value: 10
;systemd_interval = 10

This should be configurable in this file. The block comes after the ;events.mechanism = epoll line in the upstream file.

Should be able to change user of php-fpm

It seems that there's no way to override $php::params::fpm_user. On RHEL/CentOS that means it's set to apache, which doesn't make any sense if you're using nginx.

php 5.5 has no apc available

Hi guys,
if you want to use dotdeb 5.5 with debian 7 its not working because there exist no apc anymore. maybe you want to implement that ;)

CentOS PHP Repository

This module does handle repositories for Ubuntu. However, it doesn't have a repo file for CentOS.

The most up-to-date repository for PHP seems to be remi-php56. As this seemingly supports all enterprise Linux flavors such as RHEL and CentOS, adding this will increase this module's repository coverage.

Thanks a lot for your great work.

PECL/Extension checks for beta packages

Howdy,

i have the following hiera file (snippet):

php::extensions:
  geoip:
    provider: pecl

When i run puppet multiple times i always get:

Notice: /Stage[main]/Php/Php::Extension[geoip]/Package[pecl-geoip]/ensure: ensure changed '1.0.8' to '1.1.0'

The installed version is still 1.0.8:

Package   Version State
geoip     1.0.8   stable

Version 1.1.0 of geoip is in beta state. I get the same with other packages (e.g. memcache).

Is this a hiera configuration mistake by me?

Thanks,
Patryk

Could not find command 'pear'

Hi!

I run into this one today.... I didn't have package php-pear installed

Error: /Stage[main]/Php::Pear/Exec[::php::pear::auto_discover]: Could not evaluate: Could not find command 'pear'

Is it this module's responsibility to install it?

puppetlabs/apt version 1.x dependency conflict

Hi everybody!

I'm receiving the following error message during the installation of my required modules with librarian-puppet.

[Librarian] Conflict between puppetlabs-apt (~> 1.0) <https://forgeapi.puppetlabs.com> and puppetlabs-apt/2.0.1 <https://github.com/puppetlabs/puppetlabs-apt.git#2.0.1>
Could not resolve the dependencies.

I'm already using the APT module in version 2.0.1 in my puppet code.
So librarian-puppet tries to install two different versions of the module and breaks.

Is it possible to change the mayflower/puppet-php dependency for APT module to an newer version e.g 2.x?
Thank you very much!

extensions with pecl provider cause issue with Augeas

A puppet apply fails due to augeas trying to save a temp file in /etc/php5/mods-available before that folder exists because there is no dependency on the package that creates the folder.

==> default: Debug: Augeas[php-mailparse-config](provider=augeas): Opening augeas with root /, lens path /usr/share/augeas/lenses/contrib, flags 64
==> default: Debug: Augeas[php-mailparse-config](provider=augeas): Augeas version 1.2.0 is installed
==> default: Debug: Augeas[php-mailparse-config](provider=augeas): Will attempt to save and only run if files changed
==> default: Debug: Augeas[php-mailparse-config](provider=augeas): sending command 'set' with params ["/files/etc/php5/mods-available/mailparse.ini/.anon/extension", "mailparse.so"]
==> default: Debug: Augeas[php-mailparse-config](provider=augeas): Closed the augeas connection
==> default: Error: /Stage[main]/Php/Php::Extension[mailparse]/Php::Config[mailparse]/Augeas[php-mailparse-config]: Could not evaluate: Save failed with return code false, see debug

The code to duplicate that would be:

  class { '::php':
    fpm          => true,
    apache       => false,
    composer     => true,
    phpunit      => true,
    manage_repos => false, # use default ubuntu repo
    extensions   => {
      'mailparse' => {
        ensure   => 'installed',
        provider => 'pecl',
      },
    },
  }

In Debian/Ubuntu, it is Package['php5-common'] that is installed as a dependency of all PHP packages, so any package should fix the issue.

I fixed it from the outside with the following Resource Collector to add the dependency:

PHP::Extension <| provider == 'pecl' |> {
  require +> Package["php5-cli"], # should be php5-common
}

Can't send errors to syslog in php-fpm.conf

It's not possible to set error_log = syslog

If this ability is added, it should also be possible to configure the syslog facility or identity (syslog.facility and syslog.ident)

Use puppetlabs/inifile instead of augeas

Currently, setting PHP config parameters in an php.ini through php::config is very cumbersome because augeas statements must be passed. As it's a regular ini file, we should use the module puppetlabs/initfile instead and refactor the config handling.

As this is a breaking change, we need a new major version.

pecl extensions' .so sometimes are named differently

If you want to install the http extension through pecl, its name must be "pecl_http" as that is the way it is distributed in pear. But the extension file it creates is called "http.so" so it is not possible to install it properly using your module.

A very simple workaround that will solve the issue for any other such instance while being completely backwards-compatible would be to make the following change to the extensions manifest in line 83:

    'pecl'  => concat(["set .anon/extension '${name}.so'"], $config),

That way, you can override the file loaded using the $name variable that is equal to $title unless specified otherwise

Error installing fpm on ubuntu

Hi:

On ubuntu, php5 packages can be installed. As far as i see, problem is puppet try to install "-cli", "-common" packages (forget php5 prefix)

My hiera config:

classes:
  - ::php
  - php::cli
  - php::packages
  - php::fpm
php::ensure: latest
php::manage_repos: true
php::fpm: true
php::dev: true
php::composer: true
php::pear: true
php::phpunit: false
php::fpm::config:log_level: notice
php::composer::auto_update: true

I solve it change some values.
Diff is attached

diff -r --exclude=.git php/manifests/fpm.pp php-gh/manifests/fpm.pp
13c13
<   $package  = "${php::params::package_prefix}${php::params::fpm_package_suffix}",

---
>   $package  = "${php::package_prefix}${php::params::fpm_package_suffix}",
diff -r --exclude=.git php/manifests/packages.pp php-gh/manifests/packages.pp
18c18
<     $php::params::common_package_suffixes, $php::params::package_prefix

---
>     $php::params::common_package_suffixes, $php::package_prefix
32d31
<  

customizing pool parameters

hi everyone

since i am new to puppet i have a hard time understanding what i need to write inside my manifest file in order to change the pool listen parameter to unix:/var/run/php5-fpm.sock, user to nginx and group to nginx?

thanks

Update documentation

At least README.md and the code documentation (classes and parameters) should be up-to-date.

php5-fpm service fails with "invalid byte sequence in US-ASCII"

The php5-fpm service fails to start on Ubuntu Trusty with an error message like this:

Error: /Stage[main]/Php::Fpm::Service/Service[php5-fpm]: Could not evaluate: invalid byte sequence in US-ASCII
Notice: /Stage[main]/Php::Fpm/Anchor[::php::fpm::end]: Dependency Service[php5-fpm] has failures: true
Warning: /Stage[main]/Php::Fpm/Anchor[::php::fpm::end]: Skipping because of failed dependencies
Notice: /Stage[main]/Php/Anchor[php::end]: Dependency Service[php5-fpm] has failures: true
Warning: /Stage[main]/Php/Anchor[php::end]: Skipping because of failed dependencies

The issue comes from the file /etc/init/php5-fpm.conf which contains some non-ascii characters for the upstart script author Ondřej Surý. Manually replacing this with pure ASCII characters fixes the issue.

Since I am not sure who can fix this issue I am adding it here for others to find.

See also this issue on ask.puppetlabs.com and in cookbook-php-fpm.

php::ensure: 'version' not compatible with RHEL/Amazon

This style of setting the php version doesn't work correctly without additional handling because the way the packages are named in the repositories.

Yum expects the prefix to be the following
'php' => php 5.3
'php54' => php 5.4
'php55' => php 5.5

php::ensure: 5.4 produces the package name of php-5.4

It looks like there is a package_prefix variable but it's not exposed to hiera rendering it useless in a role/profile/node configuration.

extensions with pecl provider are not enabled

When using regular packaged extensions, the system automatically enables them (in Debian/Ubuntu by adding a link to /etc/php5/mods-available in /etc/php5/fpm/conf.d and /etc/php5/cli/conf.d).

This does not happen with extensions installed through pecl and there is no way to do so with the manifests not allowing usage of internal classes from the outside.

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.