voxpupuli / puppet-php

Generic Puppet module to manage PHP on many platforms
http://forge.puppet.com/puppet/php
MIT License
87 stars 268 forks source link

Ubuntu: php5query does not exist in 12.04 #167

Open antaflos opened 8 years ago

antaflos commented 8 years ago

Commits 4d476dc3c771c32ec92d23d8d4b3c439f54c2c53 and 2aa806182a287d999bcbdc7fd39106de25be5148 introduce the usage of php5query to check if extensions are already enabled.

This fails on Ubuntu 12.04 and the default PHP 5.3 (as well as with 5.4 provided by ppa:ondrej/php5-oldstable) because php5query is not provided by any PHP packages prior to PHP 5.5. The result is failing Puppet agent runs:

Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Caching catalog for 3b3mapp01-prod.app01.prod.rz01.riseops.at
Info: Applying configuration version '1458637880'
Error: /Stage[main]/Profile::Php/Php::Extension[gd]/Exec[/usr/sbin/php5enmod gd]: Could not evaluate: Could not find command '/usr/sbin/php5query'
Error: /Stage[main]/Profile::Php/Php::Extension[mcrypt]/Exec[/usr/sbin/php5enmod mcrypt]: Could not evaluate: Could not find command '/usr/sbin/php5query'
Error: /Stage[main]/Profile::Php/Php::Extension[mysql]/Exec[/usr/sbin/php5enmod mysql]: Could not evaluate: Could not find command '/usr/sbin/php5query'
Notice: /Stage[main]/Php::Fpm::Service/Service[php5-fpm]: Dependency Exec[/usr/sbin/php5enmod mcrypt] has failures: true
Notice: /Stage[main]/Php::Fpm::Service/Service[php5-fpm]: Dependency Exec[/usr/sbin/php5enmod gd] has failures: true
Notice: /Stage[main]/Php::Fpm::Service/Service[php5-fpm]: Dependency Exec[/usr/sbin/php5enmod mysql] has failures: true
Warning: /Stage[main]/Php::Fpm::Service/Service[php5-fpm]: Skipping because of failed dependencies
Notice: /Stage[main]/Php::Fpm/Anchor[::php::fpm::end]: Dependency Exec[/usr/sbin/php5enmod mcrypt] has failures: true
Notice: /Stage[main]/Php::Fpm/Anchor[::php::fpm::end]: Dependency Exec[/usr/sbin/php5enmod gd] has failures: true
Notice: /Stage[main]/Php::Fpm/Anchor[::php::fpm::end]: Dependency Exec[/usr/sbin/php5enmod mysql] 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 Exec[/usr/sbin/php5enmod mcrypt] has failures: true
Notice: /Stage[main]/Php/Anchor[php::end]: Dependency Exec[/usr/sbin/php5enmod gd] has failures: true
Notice: /Stage[main]/Php/Anchor[php::end]: Dependency Exec[/usr/sbin/php5enmod mysql] has failures: true
Warning: /Stage[main]/Php/Anchor[php::end]: Skipping because of failed dependencies

Not quite sure what the best solution is here. Either implement some logic similar to php5query in the relevant unless clauses (like https://github.com/mayflower/puppet-php/blob/master/manifests/extension.pp#L185) or go back to the way things were handled before the introduction of php5query in this module, at least for Ubuntu 12.04.

fadenb commented 8 years ago

As anything older than PHP version 5.5 is no longer supported I do think it is not worth to complicate the modules code. If this is a non issue for versions >= 5.5 I tend to close this issue.

@globin @mmoll: your opinions?

mmoll commented 8 years ago

If we clearly state that PHP <5.5 is not supported by this module, although distros still support it, ok.

The main point here would be that PHP 5.4 is EOL upstream-wise.

antaflos commented 8 years ago

Then you should also make it clear that Ubuntu 12.04 is not supported by this module, unless something like ppa:ondrej/php5-5.6 is enabled. And even then, from the looks of it, Ubuntu 12.04 is not quite treated as a first-class citizen by that PPA so I am not sure how well it'll work with this module. Unfortunately some of us are stuck with 12.04 for at least another year (then it'll be EOL'd).

fpletz commented 8 years ago

As Ondřej clearly states that the ppa for PHP 5.4 is "unsupported, probably vulnerable" (https://launchpad.net/~ondrej/+archive/ubuntu/php5-oldstable), we will drop support for PHP 5.4 in our 4.0.0 release. Adding another compatibility layer to support such a variety of old and incompatible PHP and operating system versions is not worth the hassle for us to implement. Sorry.

PHP 5.5 is available for 12.04: https://launchpad.net/~ondrej/+archive/ubuntu/php5?field.series_filter=precise

Before relasing 4.0.0 we have to:

fpletz commented 8 years ago

One thing we can offer you, though: If you want to have another version without the changes we could release a 3.x version with some commits from master reverted. In this case, please ensure and test that reverting the offending commits does indeed fixes things for you on 12.04 and prepare a branch we can use for a release. We don't have time to take care of this ourselves as we're not running 12.04 or PHP 5.4 anymore.

SanderSander commented 8 years ago

I believe this is fixed on the master with $ext_tool_enabled when set to true on debian the php5enmod and php5query are not used. (Requirement for php 7) but this will also work on php 5.3 / 5.4