voxpupuli / puppet-php Goto Github PK
View Code? Open in Web Editor NEWGeneric Puppet module to manage PHP on many platforms
Home Page: http://forge.puppet.com/puppet/php
License: MIT License
Generic Puppet module to manage PHP on many platforms
Home Page: http://forge.puppet.com/puppet/php
License: MIT License
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.
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?
Default package prefix should be php5- but some repositories use php53 etc.
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.
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
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 }
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
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?
The ini path changed from /etc/php5/conf.d
to /etc/php5/mods-available
.
This causes issues when not using the PPA on at least ubuntu precise.
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
Use global composer installation for PHPUnit instead of PEAR, depends on #4
Offenders:
php::apache::config
php::cli::config
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.
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
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
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. 🐐
Create a utility for composer to:
The pecl provider currently does not recognize installed modules if the package name is prefixed with pecl-
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.
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?
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
The pool_base_dir is not set in php-fpm.conf.erb
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 ;)
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.
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.
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.
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 ;)
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.
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
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?
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!
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
}
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
)
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.
We should integrate exi@26f95d8aa82e315eedd1a02eb70edb5660075974
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
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
<
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
At least README.md
and the code documentation (classes and parameters) should be up-to-date.
Hi,
pecl upgrade gnupg dont works on a fresh and clean debian 7 machine. but pecl install gnupg does the job. please fix the pecl provider. :)
https://github.com/mayflower/puppet-php/blob/master/lib/puppet/provider/package/pecl.rb
greetings snooops
We should expose which version of the PHP packages to install if there are more versions available in the distro's package manager (or slots in Gentoo).
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.
Hi,
i'm having a hard time to figure out how to switch to the wheezy-php56 repository. Is this supported?
Cheers,
Patryk
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.
Not able to change listen from 127.0.0.1:9000 to unix:/var/run/php5-fpm.sock
I have tried
I tried
php::fpm::pool::listen: 'unix:/var/run/php5-fpm.sock'
In the hiera yaml file but makes no difference.
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.
We are currently only testing an embarrassingly small portion of our manifests. We need to fix this!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.