puppetlabs-apache icon indicating copy to clipboard operation
puppetlabs-apache copied to clipboard

Support for mod_php on Ubuntu 22.04

Open xchotard-talentsoft opened this issue 3 years ago • 5 comments

Summary

Fixes #2259

Changes

  • Added PHP version for Ubuntu 22.04 (and 16.04) to the $php_version mapping in params.pp.
  • In mod/php.pp added conditions for Red Hat family that has a specific behavior with PHP 8.x modules name convention.

Tests

Tested with the following Puppet code:

class { 'apache':
  mpm_module => 'prefork',
}
class { 'apache::mod::php': }

To validate that PHP works:

# Don't do this in production servers!
echo "<?php phpinfo(); ?>" > /var/www/html/phpinfo.php

Then open http://<sandbox_ip>/phpinfo.php

Works on:

  • Ubuntu 16.04
  • Ubuntu 18.04
  • Ubuntu 20.04
  • Ubuntu 22.04
  • CentOS 7
  • CentOS 8
  • Debian 11

I could not test SLES because it's not free. I tried openSuse Leap 15.4 but the module does not seems to work for other reasons.

xchotard-talentsoft avatar Aug 05 '22 08:08 xchotard-talentsoft

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

CLAassistant avatar Aug 05 '22 08:08 CLAassistant

apache::mod::php is a class

Breaking changes to this file WILL impact these 49 modules (exact match):
Breaking changes to this file MAY impact these 36 modules (near match):

apache::params is a class

Breaking changes to this file WILL impact these 7 modules (exact match):
Breaking changes to this file MAY impact these 4 modules (near match):

This module is declared in 174 of 579 indexed public Puppetfiles.


These results were generated with Rangefinder, a tool that helps predict the downstream impact of breaking changes to elements used in Puppet modules. You can run this on the command line to get a full report.

Exact matches are those that we can positively identify via namespace and the declaring modules' metadata. Non-namespaced items, such as Puppet 3.x functions, will always be reported as near matches only.

Relevant previous effort: https://github.com/puppetlabs/puppetlabs-apache/pull/2163

Tested with the following Puppet code:

class { 'apache':
  mpm_module => 'prefork',
}
class { 'apache::mod::php': }

To validate that PHP works:

# Don't do this in production servers!
echo "<?php phpinfo(); ?>" > /var/www/html/phpinfo.php

Then open http://<sandbox_ip>/phpinfo.php

This would be a great acceptance test. In fact, there already is https://github.com/puppetlabs/puppetlabs-apache/blob/main/spec/acceptance/mod_php_spec.rb but that doesn't run anything like curl to see if it actually renders.

ekohl avatar Aug 05 '22 09:08 ekohl

@xchotard-talentsoft If you could add Ubuntu 22.04 to the metadata that should activate the tests against it to double-check this change. From my own pr added Certification for the OS it look's like yours should fix all outstanding issues.

david22swan avatar Aug 05 '22 10:08 david22swan

@xchotard-talentsoft If you could add Ubuntu 22.04 to the metadata that should activate the tests against it to double-check this change. From my own pr added Certification for the OS it look's like yours should fix all outstanding issues.

Done, but I haven't tested any of the other apache modules.

xchotard-talentsoft avatar Aug 05 '22 11:08 xchotard-talentsoft

@xchotard-talentsoft Hey, as part of my scheduled work to get all our our modules to support Ubuntu 22.04 have finalized the work started by you and added it to the pdksync PR shown here and was hoping you could give it a quick review.

Hope there's no offense taken, just need to get this done so I can move onto my next task. Pinging @ekohl as well

david22swan avatar Aug 17 '22 15:08 david22swan

@xchotard-talentsoft Closing this as the need has bee filled by another PR. If there is anything else that you wanted to get in with it please re-open and comment.

Thank you for all your work

david22swan avatar Sep 05 '22 10:09 david22swan